Oxidation number of hydrogen in compounds
You can look at the electronegativity of the atom Hydrogen is bonded too.

For instance, in NaH the electronegativity of H is greater than that of Na (~2.1 as opposed ~.9) so H two would have an oxidation state of -1) 

In HCl, we observe that Cl is more electronegative so it will have an oxidation state of -1 and H will have an oxidation state of +1

In borane (even though B is a non-metal) each hydrogen displays an oxidation state of -1 (again electronegativity of H is 2.1 as opposed 2.0 of B)

Hope this makes sense.