Carbon dioxide is a very soluble gas. It dissolves readily in water. As the oceans formed, carbon dioxide dissolved to form soluble carbonate compounds so its amount in the atmosphere decreased. Carbonate compounds were then precipitated as sedimentary rocks, eg limestone.