Barium is an alkaline earth metal. This means that it is a group 2 element. Barium's atomic number is 56; this means that it has 56 protons in its nucleus and also puts it as a period 6 element. An uncharged barium atom would have 56 electrons also. However as a group 2 element barium easily loses 2 electrons to form the +2 cation. The ion has 56-2=54 electrons. The electronic configuration is as follows:
1s2 2s2p6 3s2p6d10 4s2p6d10 5s2p6
This is a total of 54 electrons. The uncharged barium atom would also have its 6s2 electrons for a total of 56.