A covalent bond is one that is formed by two non-metal elements that, due to their low electronegativity difference, neither has the energy to steal the electrons from the other, so they share electrons with each other.
Covalent bonds form when the electronegativity difference between two elements is less than 1.7. In addition, the number of elements must be such that by sharing their electrons, all elements comply with the octet rule, that is, each element shares and completes 8 valence electrons.