Element that would tend to gain two electrons
An element tends to gain two electrons if it needs only two electrons to attain the stable noble gas configuration.
Thus, the general electronic configuration of such an element should be ns2 np4. This is the electronic configuration of the oxygen family, i.e., the element can be O(2p4), S(3p4), Se(4p4), Te(5p4), Po(6p4).