In order for carbon to be stable and have 8 electrons, it must make 4 total covalent bonds. 
In prefer for oxygen to be stable and have 8 electrons, it must make 2 covalent bonds. 
So, we can deduce that CO2 looks like this: 
O=C=O
This molecule has two double bonds. 
Pssst...Can I get a brainliest?