In which of the following cases do iron rust?
When exposed to both water and oxygen.
For iron to rust, it must be exposed to both oxygen and water. Iron does not rust when exposed to oxygen or water individually. Nitrogen being a relatively inert gas does not react with iron.