When atoms share one pair of their valence electrons, a single covalent bond is formed between the atoms. Atoms that share two or three pairs of electrons form covalent double bonds or covalent triple bonds, respectively.
All atoms, except those of the noble gases, have a tendency to move their valence electrons in a manner that allows them to achieve a stable noble-gas electron configuration. The valence electrons can either be transferred between atoms or shared. When electrons are transferred from one atom to another, an ionic bond is formed. When two atoms share valence electrons, a covalent bond is formed. Atoms in a covalent molecule are held together by the electrostatic force of attraction between the positive nuclei of the atoms and the negative charge of the shared electron pairs between them.
Covalent bonds are formed between non-metal atoms. Non-metals are characterized by their ability to achieve their nearest noble-gas structure by gaining one to four electrons in their valence shell, depending on how many they need. Rather than gaining a stable electron configuration through the transfer of electrons, in covalent bonds, non-metal atoms share one or more electron pairs between themselves. The electron pairs are formed by a contribution of an equal number of electrons from each atom. For example, in hydrogen chloride, one electron from hydrogen and one electron from chlorine’s valence shell are shared between the two atoms. With the shared pair, hydrogen attains an electron configuration similar to helium and chlorine attains the electron configuration of argon.