Step 1 - How can we obtain ionic compounds from H2?
A very simple way to do it is by considering redox reactions. H2 can be oxidized to H(+), losing two electrons in the process:
Therefore, if we could find any atom or molecule that is more reducible than H2, that reaction should work just fine and provide us with an ionic outcome.
Step 2 - Devising the reaction
One such element is iron, Fe. Iron can be reduced from Fe(3+) to Fe(2+) easily:
Before we join the two reactions together, we need to guarantee the number of electrons exchanged is the same. So let's multiply our last reaction by two (this is balancing it):
We can now join the two reactions together:
Note that there are two electrons in both sides: we can just cancel them out, to obtain the already balanced equation: