The atoms of a compound are held together by chemical bonds formed by the interaction of electrons from each atom. According to the octet rule Section 5.7C1, atoms bond together to form molecules in such a way that each atom participating in a chemical bond acquires an electron configuration resembling that of the noble gas nearest it in the periodic table. Thus the outer shell of each bonded atom will contain eight electrons (or two electrons for hydrogen and lithium).
(more content follows the advertisement below) A D V E R T I S E M E N T
The simplest chemical bond is that formed between two hydrogen atoms. Each hydrogen atom has one electron. As the two atoms approach each other, the nucleus of one atom attracts the electron of the other. Eventually the two orbitals overlap, becoming a single orbital containing two electrons (see Figure below).
FIGURE: Two hydrogen atoms, each with one electron, combine to form a hydrogen molecule, in which the two electrons are shared between the atoms and serve to give each atom a filled valence shell.
This orbital encompasses space around both nuclei. Although the electrons may be in any part of this orbital, we can predict that they are most likely to be in the space between the nuclei, shielding one nucleus from the other and being attracted by both. In the resulting molecule, both atoms have two electrons and a filled outer (valence) shell. These shared electrons form a bond between the two atoms. This chemical bond is a covalent bond, a pair of electrons shared between two atoms. When this bond forms, energy is released. This release of energy shows that the molecule of hydrogen is more stable than the separate atoms.