Covalent bonding is 2 non-metal atoms bonding together so they can share an electron
That is very intersting
Above you can see 2 oxygen and 1 carbon right next to each other. Since oxygen has 2 missing electrons and carbon has four that it can share, you can put 2 oxygen so it can share with the carbon. Once they combine they will form CO2.
Also to know is that 1 pair of electrons is equal to 2 valence electrons. So if you have a double bond it would have to share 4 valence electrons.