You can solve this problem in pure algebraic way counting atoms.
a(2N) + b(2H) = c(N+3H)
You should solve the problem in integers.
Putting tentatively a=1 we have 2=c and 2b=3c from which b=3.
Finally chemical equation (in molecules) should be:
N2 + 3H2 = 2NH3
or analogously:
putting b=1 we have 2=3c => c=2/3 and a=1/3
(1/3)N2 + H2 = (2/3)NH3
and finally
N2 + 3H2 = 2NH3
and so on