finally today I am going to explain the huge mistake in valence electrons of most metals. This is a mistake that I guess that most teachers learn and you will find it all around the internet, if it is not there then it is probably not explained accurately.
When people usually write out the electron configuration of atom or ion they use the quantum number of the atom to get it and then it depends if the atom is in s,p or d part of periodic table.
Those atoms have valence electrons in the respective orbitals.
Oxygen for example is p-atom. It is in second period so the highest orbitals will have the number 2. All p-atoms have full s-orbitals and oxygen has four spare for p-orbital.
O: [2s]2 ; [2p]4 (lets write it like this, four electrons in p-orbital and two in s.)
This is the usuall way and it works quite well, except when it does not.
The problem comes with transition metals (which is most of the table), those are metals in the d-group, the ones in the middle. Particularly you will see the mistake with 6th and 11th collumn. If you would write the configuration for Chromium for example it should go like this:
Cr: [4s]2 ; [3d]4 (d-orbital is always -1)
But whoops! There is mistake! Why? Because you are assuming that the energy of the orbitals continues to go like this, that 4s orbital has lower energy than 3d. This happens not to be true in this case, generally the difference is very small, the nucleus changes as you add protons and neutrons to it which may change the balance. Now in this case it does change the balance, I do not understand the mechanics behind it so you will have to deal with this. The right configuration of Cr is this:
Cr: [4s]1 ; [3d]5 (the number of electron remains the same)
Also 4s is close so it is not very stable to put there one more electron when you have nice free 3d orbital.
This problem occurs again with molybden but not tungsten and seaborgium! This is because the effect is not strong enough, the atom looks different and so on. As I mentioned this mistake is also in 11th collumn which is copper, silver, gold and roentgenium. These guys have full d-orbital and only one electron in s-orbital.
Of course if you create ions you will bump into this again. Vanadium which is right next to chromium has the problem again,
V5+ ; V4+ 3d1 ; V3+ 3d2 ; V2+ 3d3 ; V+ 3d4 ; V 3d34s2
Sometimes this whole problem is explained as that d-orbital is more stable when half full or full completely. This is false since clearly it does not explain tungsten which behaves normally.
If you get to write configurations of transition metals check out this page, it will show you exactly how it looks like and you wont do mistake. Also I used these pages for the answer so check out these if you are not sure about something: 1) 2)