Group 2 elements have 2 valence electrons. They can donate 2 electrons to make their octet complete. So, they have 2 valency. [1 mark]
Group 17 elements have 7 valence electrons. They can accept 1 electrons to make their octet complete. So, they have 1 valency. [1 mark]