We know from the periodic table that a carbon atom has 4 valence electrons in the outermost shell.
In order for the atom to be more stable, the outermost shell must be filled up.
Carbon follows the octet rule of electron configuration. It means the atom needs 8 electrons in the outermost shell to be filled.
You can read more about the octet rule here.
When two carbon atoms bond together, they each share 1 electron to form a single bond.That leaves three valence electrons available for bonding.
Single, double, and triple bonds
Single bond — 1 atom shared from each atom
Double bond — 2 atoms shared from each atom
Triple bond — 3 atoms shared from each atom
Here’s a trick – if you draw a line through the middle between the bonds, you should be able to work out exactly 4 bonds on each side, because each carbon atom has 4 bonding electrons which are the valence electrons.
The diagram below shows part of a complex molecule that consists of single and double bonds.
Since carbon can only form 4 bonds, the total number of bonds around each carbon atom must not exceed 4.
To achieve the octet rule, carbon must have a total of 4 bonds.
You’ll notice that around each carbon atom in the molecule, a total of 4 bonds must exist.