# Why does the octet rule exist?

The octet rule exists because the atoms of many elements become more stable by attaining a noble gas electron configuration.

Most noble gases have eight valence electrons (He has only 2) which gives them a full outer shell of electrons in the s and p sublevels of their highest energy level.

Ne = $1 {s}^{2} 2 {s}^{2} 2 {p}^{6}$ for example (note the total of 8 electrons in energy level 2)

The elements near neon on the periodic table will form compounds in order to add or lose electrons to achieve an electron configuration which matches that of neon.

F forms -1 ions by adding one electron going from $1 {s}^{2} 2 {s}^{2} 2 {p}^{5}$ to $1 {s}^{2} 2 {s}^{2} 2 {p}^{6}$ in ionic compounds such as NaF.

F can add one additional electron by forming a single covalent bond with another atom. This occurs when F atoms bond to each other when forming a diatomic molecule (F-F).

There are elements which are exceptions to the octet rule which do not require 8 valence electrons to be stable. Hydrogen needs only two valence electrons to fill its 1s sublevel, so H atoms form just one covalent bond.