Atoms will lose, gain or share electrons to achieve the electron configuration of the nearest noble gas (8 valence electrons except for He with 2).