Based on the valence electron(s) and valence shell
If the valence shell is full with valence electrons, than it will have less reactivity causing it to have lower chance to combine with other atoms as it is already stable
If the valence is not full with valence electrons, than it will have more reactivity causing it to have a higher chance to combine with other atoms, as it wants a full valence shell to be stable instead of its current unstable state
The longer the atomic radii, the further the valence shell, the more reactive due to weak attraction of nucleus
The shorter the atomic radii, the closer the valence shell, the less reactive due to strong attraction to nucleus
Example: One atom of nitrogen combines with three atoms of hydrogen to form ammonia gas. So, the valency of nitrogen is 3.