'when' introduces a short interrupting event; 'while' introduces an ongoing background action. Master these connectors with 40 questions.
'when' is followed by a short Past Simple action that interrupts an ongoing Continuous action: I was watching TV WHEN the phone rang.