Most coins don't rust. In common terminology rust is a form of iron oxide and occurs only when a ferrous metal such as iron or steel is exposed to air and moisture. Many coins issued around the world are instead made of metals that aren't subject to rusting; e.g. nickel, copper, aluminium, etc. These metals can still oxidize but the damage is almost always far less than what would happen to unprotected steel.
Some countries, though, make coins from ferrous metals because they're less expensive than non-rusting alternatives. In these cases the steel is plated or bonded with some kind of non-ferrous metal (usually nickel or copper) to prevent direct air contact.
There were cases of steel-based coins rusting before modern plating techniques were developed. Among others: