What a covalent bond is
Atoms are most stable when their outer shell is full. When two non-metals react, neither atom can easily give electrons away, so they share electrons instead.