Every element wants stability due to the unpaired electron in p or s subshell element feels unsymmetric electromagnetic forces from the nucleus and other electrons.
To gain stability they want to fill completely the subshell by the electrons to convert unsymmetric electromagnetic forces to symmetric electromagnetic forces.