When I got home, my brother was cooking.

我回到家的时候,哥哥正在做菜。

If it rains tomorrow, we will stay home.

如果明天下雨,我们就待在家。

when / if 是把一个句子包起来,接到另一个句子的连词。when / if + 主语 + 动词 的组合可以放句首或句尾。放句首时用逗号隔开。

规则○×
就算是未来的事,里面用一般现在时If it rains tomorrow, …If it will rain tomorrow, …
放后面也可以I will call you when I get home.I will call you when I will get home.
“如果你忙”不能省掉主语 youIf you are busy, I will help you.If busy, I will help you.

就算说“如果明天下雨”这种未来的事,when / if 里面不用 will,用一般现在时。will 加在外面的句子。

说过去的事时,依内容用过去式或过去进行时(When I was a child, I liked dogs. / When I got home, my brother was cooking.)。