J.R. S. answered 01/08/20
Ph.D. University Professor with 10+ years Tutoring Experience
Only certain metals are "active" enough to react with nitric acid (HNO3) to produce hydrogen gas (H2). And it also depends on the concentration of the nitric acid. For example, magnesium (Mg), Manganese (Mn) and Zinc (Zn) will react with dilute HNO3 as follows:
Mg + 2HNO3 ==> Mg(NO3)2 + H2
Mn + 2HNO3 ==> Mn(NO3)2 + H2
Zn + 2HNO3 ==> Zn(NO3)2 + H2
Some non-active or should I say less active metals can still be oxidized by dilute HNO3 but not produce hydrogen gas. Copper (Cu) is an example. 3Cu + 8HNO3 ==> 3Cu2+ + 2NO + 4H2O + 6NO−3 Note that no H2 gas is produced by the less reactive Cu. Here the nitric acid acts as an oxidizing agent.
I guess the short answer to your question would be that some metals don't generate hydrogen gas with nitric acid because the nitric acid is a strong oxidizer and can oxidize the free hydrogen to produce water, and this again depends on the concentration of the nitric acid. It is a stronger oxidizer than it is an acid especially when concentrated. When dilute, it will or can behave as indicated above with Mg, Mn and Zn, for example.