The number of electrons in the outermost shell of an atom determines its reactivity. Noble gases have low reactivity because they have full electron shells. Halogens are highly reactive because they readily gain an electron to fill their outermost shell
Remember that the number of protons in the nucleus determines an element's identity. Chemical changes do not affect the nucleus, so chemical changes cannot change one type of atom into another. The number of protons in a nucleus does change sometimes, however. The identity of the atom, therefore, changes.
When non-metal atoms ionize they gain electrons.<span> Some examples of this are the halogen elements: F, Cl, Br and I, each, can gain one electron from the respective anions, F-, Cl-, Br-, and I-. O and S, may gain two electrons to form the anions O2- and S2-. This is due to the fact that those elements only need one (in the case of the halogens) or two (in the case of O and S) electrons to reach the most stable configuration of the closest noble gas (with the last shell of electrons full), so they are ready to gain those electrons and form the corresponding ions.</span>