TLDR: If you're not running A/C, you should never recirculate air (position 2) and always draw fresh air (position 1). You never need recirculating, but it helps air conditioning work a little better. And A/C is very effective at clearing fog, even with heat too!
You need to know how to defog windows
Air has water in it. Windows fog over when the air is very humid.
If it's raining, most likely outside air is at 100% of its capacity to hold water. Your car is taking that in. Also, you are adding humidity to the car from your breath, sweat and wet clothes.
Warm air can hold more water. So if you run your heater, it will reduce fogging. Of course that may be no fun on a 30C night.
Use the air conditioning
The air conditioner makes the air quite cold. Remember, cold air can't hold nearly as much water, so the water falls out! That's how dehumidifiers work.
If you run A/C with the heat temperature high, the car will re-heat the air conditioned air. This will make it very, very dry.
If it's cold out, turn on the A/C and set max heat. This will defog the car in a few seconds.
If it's too cold out (below freezing) the A/C may not be able to run at all. The Freon system works fantastic at low temperatures, but the evaporator core will tend to ice up. Recirculation can help slow that down.
To recirculate, or not?
That lever decides whether to draw fresh air from outside the car (position 1), or whether to recirculate air already inside the car (position 2).
Generally you want fresh air most of the time -- for many reasons. If you don't have A/C, recirc is nearly useless. I never use it.
If you are not using A/C and simply using the heater to dehumidify, you need fresh air, otherwise your own humidity will add to the humidity already in the car and fog you up.
If you are using A/C to dehumidify the air, it helps to recirculate, because the air inside will be drier from already having been through the A/C.