To balance the equation
a Mg3N2+b H2O→Mg(OH)2+dNH3
Go by trial and error method first balancing metals and lastly oxygen
Mg3N2+6 H2O→3Mg(OH)2+2NH3
Hence a=1,b=6,c=3,d=2