Number of covalent bonds by an atom is equal to number of unpaired electrons.
Step-by-step explanation:
Valency of an atom is defined as the combining capacity of an atom. Valence electrons are defined as the number of electrons in the outermost shell of an atom.
Now for an atom, when more than one electrons are present, then they often forms a pair. Like for example, if there are 7 valence electrons, 6 get as pairs and only one electron is unpaired. So this is why the halogens like fluorine, chlorine etc has the Valency of 1. For oxygen, 4 valence electrons become paired. And rest 2 electrons form 2 covalent bonds.