Here's why:
* Covalent compounds are formed when two or more nonmetals share electrons to achieve a stable electron configuration.
* Carbon and oxygen are both nonmetals.
* In carbon dioxide (CO2), the carbon atom shares two pairs of electrons with each oxygen atom, forming double bonds.
Let me know if you'd like more information about covalent bonds or carbon dioxide!