The elements that form anions will have the electronic configuration similar to the noble gas that is in their period and those that form cations will have a configuration similar to that of the noble gas in the previous period.
He: Be
Ne: F, Al
Ar: Ca, P
Kr: Rb, Se