$1$ mole of $Ba(N_3)_2(s)$ will give $3$ moles of $N_2$
hence $\frac{{1\,g}}{{221\,g/mol}}$ moles of $Ba(N_3)_2(s)$ will give $3 \times \frac{1}{{221}} = 0.014$ moles of $N_2$
$(b)$ Molar mass of ${(N{H_4})_2}C{r_2}{O_7} = 252\,g/mol.\,$
$1$ mole of ${(N{H_4})_2}C{r_2}{O_7}$ will give $1$ mole of $N_2$
hence $\frac{{1\,g}}{{252\,g/mol}}$ moles of ${(N{H_4})_2}C{r_2}{O_7}$ will give $1 \times \frac{1}{{252}} = 0.0039$ moles of $N_2$
$(c)$ Molar mass of $NH_3 = 17\,g/mol.$
$2$ mole of $NH_3$ will give $1$ mole of $N_2$
hence $\frac{{1\,g}}{{17\,g/mol}}$ moles of $NH_3$ will give $\frac{1}{{2 \times 17}} = 0.0297$ moles of $N_2.$
$(d)$ Molar mass of $NH_4NO_3 = 80\,g/mol.$
$1$ mole of $NH_4NO_3$ will give $1$ mole of $N_2$
hence $\frac{{1\,g}}{{80\,g/mol}}$ moles $NH_4NO_3$ will give $1 \times \frac{1}{{80}} = 0.0125$ moles of $N_2$
Hence Thermal decomposition of $NH_3$ will produce maximum amount of $N_2$