1)) When
1. I was eating food when he called me.
2. She was out of town when got a letter from them.
3. He was watching a film when the teacher came.
4. Everybody was quiet when the teacher was in class
2)) While:
1. I don't want you to drive while you're so tired.
2. He waited while his brother took a shower.
3. Everybody was at school while she went to the cinema.
4. She went outside while her friend was studying