The atoms that form covalent bonds are the nonmetals (p-block elements), and they must have an electronegativity difference lower than 1.7. These values also help to classify the covalent bond into two kinds, polar and nonpolar.
The number of covalent bonds an atom can form depends on its valency. An atom’s valency is the number of electrons that is in excess or less to reach a stable noble gas configuration. The stable noble gas configuration has 8 electrons in the outermost shell. The atom will try to lose, gain, or share electrons to reach the coveted number 8. Therefore, valency is indicative of the combining capacity of the atom.
The common atoms of the p-block elements that engage in covalent bond formation have valencies 4, 3, 2, and 1. The Carbon group has valency 4, the Nitrogen group has valency 3, the Oxygen group has valency 2, and the Halogen group has valency 1.
The outermost shell of carbon has 4 electrons. It has 4 electrons less from a stable octet configuration of Neon. Carbon combines with other atoms so that it receives four electrons, forming four new bonds. The Nitrogen is less by 3, Oxygen by 2, and Halogen by one. These atoms will then combine in a manner so that they form a 3, 2, and 1 bond. Therefore, valence also provides information on the number of bonds an atom can form.
The atom not necessarily has to find another partner to fulfill its valence; it can even form a bond with itself.
For example, Oxygen has a valency of two and can form two bonds. Oxygen can form these two bonds by combining with two Hydrogens to form a molecule of water (H-O-H), or it can form two bonds with itself to obtain an Oxygen (O=O) molecule. The Oxygen atom's valence of 2 can also be met by bonding with Carbon to form carbonyl (R2-C=O) or Carbon dioxide (O=C=O).
Nitrogen has a valency of 3 and can combine in various combinations like N2, NH3, CN, (CH3)3N, etc.
Halogen, with its valency of one, can form one covalent bond -for example, HF, CH3-Cl, Cl-Cl, etc.
Therefore, based on their valence, Carbon is tetravalent, Nitrogen is trivalent, Oxygen is divalent, and Halogen is monovalent.