A more formal way of assigning oxidation states in an A:B bond is to assign both electrons to the more electronegative element. Hence for an E-H bonds when E is a non-metallic main group element is to assign the electrons to E because they have an electronegativities greater than 2.20 the electronegativity of H; H is ∴ H^+. When bonded to a metal with
χ < 2.20 then the two electrons are given to H and it becomes H^-. But what happens when E has the same as
electronegativity as H (e.g., P and Os)? Chemists don’t lay awake at night worrying about it: there are many such fuzzy areas in chem. Turning to your question: Can H be both (formally at least) +1 and -1? In HPO(OH)2 there are two H atoms where their oxidation state is H +1 and -1. There are some cmpds with
B-H-M and Si-H-M bridges where M is a transition metal. The H atoms in these molecules have in my opinion have an oxidation number of 0 (+1/2 plus -1/2).
https://en.wikipedia.org/wiki/Electronegativity