It depends on the exact phrasing of the question, but you seemed to indicate that they were asking "Which of these substances is comprised of two moles of ATOMS?" and NOT "Which of these substances is comprised of two moles of ELEMENTS?"
As hydrogen gas naturally occurs in a diatomic state, it is true that there is only one mole of naturally-occurring elemental hydrogen in answer one, but one mole of H2 is formed from 2 moles of H.
Just to check that we are correct, let's go through all of the answer choices:
- H2 - There are 2 moles of hydrogen atoms (1 mole of elemental hydrogen). Total: 2 moles of atoms
- There are 1 mole of Carbon atoms and 2 moles of oxygen atoms (oxygen is also naturally diatomic, but we're counting atoms, not elemental configuration). Total: 3 moles of atoms
- There are 4 moles of nitrogen atoms (N2, like H2 and O2 is diatomic) and 2 of oxygen atoms. Total: 6 moles of atoms
- There are 2 moles of sodium ions and 2 of chlorine ions (you could technically point out that this answer choice doesn't even involve true atoms, but I imagine that the nuance is lost on whoever wrote the question). Total: 4 moles of ions
- There are 2 moles of hydrogen, 1 of sulfur, and 4 of oxygen. Total: 7 moles
According to this analysis, answer 1 (H2) is the only substance listed that is composed of two moles of atoms.