Explanation:
When pairs of electrons are shared by atoms the bond formed is called covalent bonds. The main reason behind the formation of these bonds are to achieve stability.
Sharing of electrons of different elements’ outermost layer of atoms takes place, also known as Valence Electrons the number of valence electrons not same for different elements so on sharing of electrons’ pairs present in the outermost shell both the atoms of different elements can fill their requirements thus the bonds from this way are covalent bonds.