Step 1: Know what a greenhouse gas is.
A greenhouse gas can trap heat by absorbing infrared radiation. The main ones are carbon dioxide, methane, nitrous oxide, ozone and CFCs.
Step 2: Understand the condition.
A set counts only if every single gas in it is a greenhouse gas. If even one gas is not, the set fails.
Step 3: Check set I.
Set I has $CO_2$, $SO_3$ and $N_2$. Nitrogen and sulphur trioxide are not greenhouse gases, so set I fails.
Step 4: Check set II.
Set II has $CO_2$, $CH_4$ and $O_3$. All three are greenhouse gases, so set II passes.
Step 5: Check sets III and IV.
Set III has $O_2$ and $SO_2$, which are not greenhouse gases, so it fails. Set IV has $O_3$, CFCs and $N_2O$, which are all greenhouse gases, so it passes.
Step 6: Pick the answer.
The sets that contain only greenhouse gases are II and IV. \[ \boxed{\text{II and IV only}} \]