Student or Learner
I was taught in my primary school that simple tense should be used after the conjunction "when", whereas continuous tense be used after "while". However, I discover that more and more people use both tenses after "when", and wonder if the rule is becoming more loose or there is something wrong with my knowledge.
It is not an absolute rule, and never has been. I think that what might have been a guideline was upgraded to a rule at your primary. While is more used with continuous forms than simple ones, though not exclusively, and when can be used with both.