Question: how many valence electrons do nonmetals have?
Answer: Nonmetals are further to the right on the periodic table, and have high ionization energies and high electron affinities, so they gain electrons relatively easily, and lose them with difficulty. They also have a larger number of valence electrons, and are already close to having a complete octet of eight electrons.