An element has 6 electrons in its M-shell

An element has 6 electrons in its M-shell. Identify the element and find its valency.

For having 6 electrons in M-shell, the atom of element must have its K and L-shell completely filled. Therefore, the electronic configuration would be 2, 8, 6(K,L,M)
Hence, atomic number =16, therefore element can be identified as sulphur (${}_{16}S$.
Since, 2 more electrons are needed to complete the octet of outer shell. Hence, the valency is 2.