Strange valence numbers?
Look closely on that site. It's not 'valence electrons' but 'valence'. There is a difference between the valence electrons and valence. 

Valence electrons are the number of free electrons in an atom that can take part in making the bond. There are 6 such electrons in the oxygen atom as you stated.

While the valence or valency is the number of bonds that can be made by the atom.

That's why valency of oxygen is 2