Talking about a condition needs a specific pattern.
Wenn es morgen regnet, (dann) bleiben wir zu Hause. If it rains tomorrow, (then) we will stay home.
The sentence with “wenn” gives the condition that influences our behaviour. The second part with “dann” (optional) gives the consequences.
Pay attention to the position of the verbs! More explainations HERE:
You can switch the sentences around, but...
Wir bleiben zu Hause, wenn es morgen regnet.
Now we have a normal main sentence (normal: S-V-O) followed by the condition with “wenn” and the verb at the end. And you can see very clear, that our subordinate sentence with “wenn” has the verb at the end.
Do not use “dann” in the beginning of a conditional sentence!
Many connection words are piling up and it makes a difference if we
1) connect two main sentences or
2) connect a main sentence and a subordinat sentence
Before your heads explode, check out this little review session! >> You can leave questions in the comments of course.