Covalent bonding is the sharing of electrons between atoms. This type of bonding occurs between two atoms of the same element or of elements close to each other in the periodic table. This bonding occurs primarily between nonmetals; however, it can also be observed between nonmetals and metals.
If atoms have similar electronegativities (the same affinity for electrons), covalent bonds are most likely to occur. Because both atoms have the same affinity for electrons and neither has a tendency to donate them, they share electrons in order to achieve octet configuration and become more stable. In addition, the ionization energy of the atom is too large and the electron affinity of the atom is too small for ionic bonding to occur. For example: carbon does not form ionic bonds because it has 4 valence electrons, half of an octet. To form ionic bonds, Carbon molecules must either gain or lose 4 electrons. This is highly unfavorable; therefore, carbon molecules share their 4 valence electrons through single, double, and triple bonds so that each atom can achieve noble gas configurations. Covalent bonds include interactions of the sigma and pi orbitals; therefore, covalent bonds lead to formation of single, double, triple, and quadruple bonds.