if it is in group 1 and 2 it has to lose electrons to satisfy its shell therefore it is a positive ion (cation).
if it is 15, 16, 17 it has to gain electrons in order to satisfy its shell (add 3, 2, 1 (in that order) electrons to get to 8) (these form anions)
group 14 depends: sometimes they tend to lose the two electrons in their outer p orbitals but retain two electrons in their outer s orbitals to form 2+ cations (tin and lead can also form molecular compounds in which all four valence electrons are involved in covalent bonding)