Here's why:
* Ionic bonds form when one atom completely transfers an electron to another atom. This creates a positive and negative ion that are then attracted to each other.
* Covalent bonds form when atoms share electrons to achieve a stable electron configuration.
In carbon dioxide:
* Carbon (C) has 4 valence electrons and needs 4 more to achieve a stable octet.
* Oxygen (O) has 6 valence electrons and needs 2 more to achieve a stable octet.
Carbon forms two double bonds with each oxygen atom, sharing two electrons with each oxygen atom. This allows both carbon and oxygen to achieve a stable octet.
Because the electrons are shared, and not completely transferred, carbon dioxide is a covalent compound.