The third condition is used to describe past situations that did not occur and past events that did not occur as a result. They can be used to represent missed opportunities. The important thing about the third condition is that both the condition and the result are currently impossible.
The sentence "If it rains, we will stay home." is correct because it uses the first conditional, which is used for real and possible situations in the future.
The structure is:
If + present simple, will + base verb.
It implies that if the condition (rain) happens, the result (staying home) will follow.
This conditional expresses a likely scenario that may happen in the future.