Bikes will rust in any situation where there is moisture and air. This produces an environment where the metal parts can get oxidized and this forms rust.
To slow down the rate of corrosion, you need storage that keeps moisture out. Obviously, the storage needs to keep out rain. However, moisture can also form inside the shed from condensation. For this reason, it is important that the bike shed is ventilated so that moist air can escape and water droplets do not form. If this does not happen, your bike can certainly rust in your storage shed.