to calculate delta ng,
we need to subtract the no. of moles of gas present on the reactant side from the no. of moles of gas present on the product side.
for example,
N2(g)+ 3H2(g) reacts to form 2NH3(g)
here no.of moles of gas product = 2
no. of moles of gas reactant =3+1=4
delta ng=2-4= -2
2A(g)+B(g) reacts to form 2D(g)
no. of moles of gas product = 2
no. of mole of gas reactant=2+1=3
delta ng = 2-3= -1
Note: delta ng can be both positive or negative.
hope it helps!!!