Here's why:
* Sun: Formed roughly 4.6 billion years ago from a giant cloud of gas and dust.
* Earth: Formed shortly after the Sun, about 4.54 billion years ago, from the same cloud of gas and dust.
* Moon: Formed even later, likely from a giant impact between Earth and a Mars-sized object about 4.51 billion years ago.
So, the Sun came first, followed by Earth, and finally the Moon.