### Theory:

Atomic bond:
Atoms can unite by sharing their unpaired electrons in their outermost shells. Each of the two combining processes contributes one electron to the electron pair required for bond formation, and they each have an equal claim on the shared electron pair.
According to the Lewis concept, when two atoms form a covalent bond, each atom achieves the stable electronic configuration of the nearest noble gas.
The covalent bond is formed by sharing electrons that become common to both atoms; it is also known as an Atomic bond.
Formation of Covalent bond:

Consider two atoms, $$A$$ and $$B$$. Assume that atom $$A$$ has one valence electron and atom $$B$$ has seven. As these atoms get closer, each one contributes one electron, and the resulting electron pair fills the outer shells of both atoms. As a result, both atoms acquire a wholly filled valence shell electronic configuration, leading to stability.

Covalent bond formation
Example:
Illustration $$1$$ - Formation of Hydrogen molecule ($$H_2$$):

Two hydrogen atoms combine to produce a hydrogen molecule.
Both hydrogen atoms contribute one electron to the shared pair during the formation of the molecule, resulting in a stable and wholly filled electronic configuration for these atoms.

Hydrogen molecule formation

Illustration $$2$$ - Formation of a Chlorine molecule ($$Cl_2$$):

Two chlorine atoms combine to produce a chlorine molecule.
There are seven valence electrons in each chlorine atom $$(2, 8, 7)$$. These two atoms establish a stable, filled electronic configuration (octet) by sharing a pair of electrons.

Chlorine molecule formation

Illustration $$3$$ - Formation of a Methane molecule ($$CH_4$$):

A methane molecule is produced by the combination of one carbon and four hydrogen atoms.
There are four valence electrons in a carbon atom ($$2, 4$$). These four electrons are shared with four hydrogen atoms to form a stable electronic configuration (octet) by sharing a pair of electrons.

Methane molecule formation

Illustration $$4$$ - Formation of Oxygen molecule ($$O_2$$):

Two oxygen atoms produce the oxygen molecule.
The valence electrons of an oxygen atom are six ($$2, 6$$). Therefore, these atoms share two pairs of electrons, resulting in a stable electronic configuration (octet). Thus, between the two atoms, a double bond is formed.

Oxygen molecule formation

Illustration $$5$$ - Formation of Nitrogen molecule ($$N_2$$):

Two nitrogen atoms produce the Nitrogen molecule.
The valence electrons of a nitrogen atom are five (2, 5). Therefore, these atoms share three pairs of electrons, resulting in a stable electronic configuration (octet). Thus, between the two atoms, a triple bond is formed.

Nitrogen molecule formation