The noble gases(except helium) have very stable electron arrangements with eight valence electrons and, therefore, tend to lack chemical reactivity. Many other atoms gain, lose, or share electrons during chemical reactions to end up with electron arrangements of the noble gases. This observation led to a chemical guideline known as the octet rule: Atoms tend to gain, lose, or share electrons until they are surrounded by eight valence electrons. Although there are exceptions to the octet rule, it is a useful rule of thumb for understanding chemical bonding
When an atom's outer shell does not contain eight electrons, it is likely to chemically bond to other atoms to fill its shell A chemical bond is the transfer or sharing of electrons that allows each atom to attain a full valence shell of electrons. Some atoms do this by transferring all of their valence electrons to other atoms so that an inner shell becomes the full valence shell.