Iron (Fe) or iron containing metals along with oxygen are essential. Moisture makes a contribution and time is necessary for the production of Iron Oxide (Rust).
The conditions needed for rusting are a ferrous alloy which does not form an adherent oxide layer and moisture.
The two conditions essential for rusting are presence of
(i) Oxygen
(ii) Water or water vapour
The chemical equation for rusting of Iron is:
Iron(Fe) + Oxygen(O2) + Water(H2O) → rust(Iron OxideFe2O3)