How did ancient astronomers know to order the planets from the closest to the farthest from the Sun? If we assume a geocentric model of the universe (like ancient astronomers did) how could we ever find out (again, like ancient astronomers did) the right distances of the planets? For example, how did they know that Jupiter is
further than Mars, if Jupiter is brighter?
According to the Cambridge Concise History of Astronomy (p 33 of my edition), essentially the Greeks took the (not unreasonable) view that the planets that moved more slowly were further away and were orbiting on larger spheres.

That's obviously not the same as suggesting they knew "the right distances" to the planets, merely the order. They did develop a mathematically sound means of estimating the distance to the Moon, though their observational data let them down on a correct estimate.

They also thought the Sun was in the fourth sphere around the Earth (to explain the observed behaviour of Mercury and Venus).

Not all Greeks thought the Sun revolved round the Earth and those who argued for a heliocentric universe said the reasons the stars did not move as the Earth did was because they were very, very far away.