So, to answer your question let's go to 322 BCC where Earth was at the center and all stars and planets revolves around it. But planet used to show unusual behavior. They use to retrograde (https://en.m.wikipedia.org/wiki/Apparent_retrograde_motion).
So, in retrogration, unlike stars, motion the planets seems to move forward then backward and again forward. To understand this go to link above.
Later to explain retrogration of planets let's go to 3rd century of BC where in the Hipparchian and Ptolemic Astronomy they used concept of epicycle to explain retrogration of planets.
So, in epicycle, there is one orbit where some invisible thing is revolving, now on this invisible thing, imagine another orbit. It is like orbit of moon in our present solar system, but we can't see earth, and in this model the orbit of moon is similar to orbit of planets. (See link for better explanation)
Now, with this we can explain retrogration motion of planets. But it lack precision. So what we can do is, introduce epicycle within an epicycle, and epicycle within it... And so on, and use FFT (Fast Fourier Transformation) to decide radius of orbits of various epicycles to match observation data.
Now you have a system where Earth is at center, stars move around it. So, do the Sun. And planets moves in FFT epicycles.