"What is the d subshell and is there a reason why you get electrons 2 in s, 6 in p and 10 in d."
The rules are due to limitations mentioned in quantum mechanics. 2 electrons can exist in an orbital, an orbital. A subshell (s,p,d etc...) has a specific number of orbitals; and has specific "shapes" for these orbitals. A subshell is inclusive of a shell.
"Does an atom with a d shell need 10 electrons instead of 8 in it's outer shell to be inert?"
Transition metals usually form coordination complexes. Yes, elements with 10 or 5 electrons tend to be more inert than others due to stability; having all five d orbitals filled, paired or unpaired...depending on the complex in question (e.g. octahedral complexes) tend to repel ionic arrangements.
"How can the valency / oxidation number be calculated from the atomic number? is there a formula that will work for all elements?"
For most elements various oxidation numbers can be found in nature. Elements may take on different oxidation states according to the stability of a complex which suffices for the oxidation state for example. However, an element by itself with the same number of protons as electrons has an oxidation state relative to noble gases.
hope this helps
------------------------------------------------------------------------------------Chemistry
http://groups.msn.com/GeneralChemistryHomework
http://www.chemicalforums.com
http://www.physicsforums.com