Fluorine atom has seven electrons in its outermost shell. Fluorine (F) atom would become stable if it acquires 8 electrons in its outermost shell. This would be possible if a fluorine (F) atom gains an electron, i.e.,
F + e– → F–
Thus, fluorine (F) atom gains one electron to complete its octet.
Sodium atom (Na) has been only one electron in its outermost shell. Sodium atom (Na) would become stable, if it could lose one electron and attain the configuration of Neon (2, 8), i.e.
Na → Na+ + e–
(2, 8, 1) (2, 8)
Thus sodium (Na) atom gains stability by losing one electron.
Two fluorine atoms can also acquire stable noble gas configurations by mutual sharing of electrons, i.e.
Thus , atoms gain stability by either losing/gaining, or by mutual sharing of valence electrons, i.e., all atoms(except hydrogen) during chemical reactions, tend to have 8 electrons in their outermost shell by either losing, gaining or by sharing the electrons .
Hydrogen atom tends to lose its only one electron in its outermost shell in all chemical reactions, or gain one more electron to have two electrons in its outer most shell (electronic configuration of He is 2 electrons in its outermost shell)