Earth's oceans formed a long time ago, billions of years ago.
As our planet was forming, it was very hot and there was no water at all.
As our planet cooled, the gases condensed into rain which means
the gasses changed from the gas phase to the liquid phase.
This caused the water to fill low areas and is why we have oceans.