8 gm
According to the law of constant proportions:
Since, Nitrogen and Hydrogen combine in the fixed proportion of 2:6 by mass to produce 8 g of Ammonia, therefore in second case also, 2g of Nitrogen will combine with 6g of Hydrogen (2:6 mass ratio) and not 12g. Hence, the same mass of Ammonia will be produced.