Covalent bonding is the sharing of electrons between atoms. This type of bonding occurs between two of the same element or 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 as well.
When molecules have similar electronegativity, same affinity for electrons, covalent bonds are most likely to occur. Since both atoms have the same affinity for electrons and neither is willing 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 since 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 can include interactions of the sigma and pi orbitals; therefore covalent bonds lead to formation of single, double, triple, and quadruple bonds.