N2 + 3 H2 -> 2 NH3
Just use their stoichiometric coefficients (number before the chemical's name) from the balanced chemical reaction to make ratios and solve for the unknown. In this case, 2 moles of NH3 are produced for every 3 moles of H2. Thus,
7.5 moles H2 x (2 moles NH3 / 3 moles H2) = 5 moles NH3
Thunderclan89