the underlying balanced equation here is
N2(g) + 3H2(g) → 2NH3(g)
which tells us based on the coefficients that the molar ratio is 2 mol NH3: 3 mol H2
from there then you can take
12 mol H2 x 2 mol NH3/ 3 mol H2 = 8 mol NH3
meaning that 8.0 moles of NH3 can be produced