Carbon atoms need 8 electrons in their outer shell, but they only have 4. So they share 4 with other atoms. These types of bonds are called covalent. They are created by electrons spinning around two atoms. Electrons spin in pairs.
Electrons stay in shells around the nucleus of the atom.
The first shell needs 2 electrons. The second and third shells need 8 electrons. If an electron is missing, it is borrowed from the bonding atom. A pair of electrons is then shared by both atoms. Carbon is the basis of biology, because its 4 bonds create structural diversity.