An easy way to work through this is to remember two anchor facts and then slot the trace gases in beneath them. The two anchors are that ordinary air is roughly $78\%$ nitrogen and roughly $21\%$ molecular oxygen, together accounting for about $99\%$ of the atmosphere, so both of these must sit above every other gas in the list.
Among the remaining trace gases, carbon dioxide is the most abundant of the three because it is a normal, continuously present atmospheric constituent at around $400\ ppm$ from respiration, combustion, and natural cycling. Carbon monoxide is not a natural steady-state atmospheric gas in the same sense; it appears only at low background levels from incomplete combustion, so it ranks below carbon dioxide. Ammonia is present at even lower background concentrations than carbon monoxide, since it is rapidly washed out of the atmosphere by rain and reacts readily with acidic pollutants.
Putting the anchors and trace gases together in decreasing order gives $N_2 > O_2 > CO_2 > CO > NH_3$.
\[\boxed{\text{Answer: (B) } N_2 > O_2 > CO_2 > CO > NH_3}\]