I would say D: 2 and 4.
The first line of the question is very important. X reacts with Y to form a gas.
For 2, we let the gas escape and measure the change in mass during the reaction.
For 4, we capture the change in volume of gas during the reaction.
1 does not work: some of the gas escapes through the cotton and the gas captured is not recorded correctly.
3 does not work: the gas is trapped and the mass balance does not record a change in mass.