Strictly speaking corn should be planted around 50m away from other varieties to ensure no cross pollination. However that's not practical in most domestic gardens. If you're short on space, planting each variety in blocks can help so that they're next to the same variety. The other option is to let each variety mature at different times as they would then have different windows of pollination time.