A covalent bond is the sharing of electron pairs between two or more atoms. The electron pairs are known as shared pairs or bonding pairs and the balance of repulsive and attractive between atoms when they share electrons is known as covalent bonding.
Covalent bonding involves the outermost electrons, located furthest from the nucleus, the so called valence electrons. When atoms form a covalent bond, these elctrons are shared between the atoms in the bond, which increases stability. This increase in stability is associted with the full occupation of the outermost energy shell, known as the octet rule. The mechanim by which this occurs involves the merging of two outermost orbitals, with each merging orbital containing one electron, producing a molecular orbital with a full complement of two electrons.