explain in detail how to find valency of barium…

**Ba = [Xe] 6s ^{2} or 1s^{2} 2s^{2} 2p^{6} 3s^{2} 3p^{6} 4s^{2} 3d^{10} 4p^{6} 5s^{2} 4d^{10} 5p^{6}6s^{2}**

So, if barium looses the 2 electrons it will attain Xe like configuration. So, its valency is two.

Similarly, find for other elements.