The number of electrons in Oxygen is 8. So, electronic configuration of oxygen is2,6.
It takes or accepts 2electrons to achieve 8 electrons in its outermost shell to complete the octet and become stable.
Hence the valency of oxygen is 2
Valency
The combining capacity of an atom is known as its valency.
The number of bonds that an atom can form as part of a compound is expressed by the valency of the element
The noble gases have an octet configuration and completely filled. other elements tends to attain the nearest noble gas configuration through losing or gaining electrons. the number of electrons needed for this case is termed as valency.