How are covalent bonds formed?
By sharing electrons.
The simplest, hydrogen, has only one electron, but all atoms "want" their outer shell to be filled.
Now by sharing their electrons, in a way two
Oxygen, that lacks two electrons to make a full (8) shell looks like:
Different atoms can also share electrons like: