Covalent bonds are forces of attraction formed when atoms of a molecule share electrons. The term sharing electrons indicates that the valance electrons of the atoms become part of the orbitals of more than one atom of the molecule.This is illustrated in the following diagrams
In the figure below are shown two individual hydrogen atoms. Each atom has one valance electron and a nucleus with one proton.
In the figure below two hydrogen atoms share the electrons of the valance orbital of the individal hydrogen atoms so that each hydrogen atom is now sharing two electrons. In this figure are also shown two other ways of depicting the hydrogen molecule. The depiction on the left is a capital H with a subscript 2 indicating there are two hydrogen atoms make up this hydrogen molecule. In the depiction on the right are two H's connected by a line. This line represents the single covalent bond composed of two shared electrons.
In the next figure are two atoms of oxygen that are sharing valance electrons. Thus the figure depicts a molecule of oxygen
In the oxygen molecule, the two atoms are sharing four electrons. This is indicated by two lines connecting the letters O.
The two lines indicate a double covalent bond.
In the next figure one oxygen atom is sharing electrons with two hydrogen atoms.Each hydrogen atom is sharing two electrons with the oxygen atom so that single covalent bonds form between the oxygen and hydrogen.