4.6 billion years ago, the earth was a big molten rock, but then it started to cool down and then gases started to get released and then it former the atmosphere, but it was made up of a lot of Carbon Dioxide and not much oxygen.
4.5-3.5 billion years ago, the earth was one massive volcano, which was pouring out carbon dioxide, water vapor and nitrogen
That is how the oceans formed, they formed from all the water vapor going into the skies and then turning into rain and it rained down.
2 billion years ago, oxygen levels started to rise steadily because bacteria and fungi are taking in carbon dioxide and giving out oxygen, so more plant life can live
The oxygen levels keep on steadily rising and so more animals can live and survive.
Finally, the earth is the place we know it is, with humans and animals living on it.