Could you kindly come up with two sentences that follow this pattern " Something happened when/while I was doing something" and show me the difference?
Okay, I'll try to explain how I understand this, and how I would begin teaching it. Be aware that what follows is a very simplified explanation that shows only a small and vague picture of usage.
First: how the uses of
while and
when can be distinct.
The choice of whether to use
while or
when is determined by the
relationship between the two clauses. That means it depends on the meaning of what is being said. To give a brief rule of thumb:
Use
while to simply stress that two events happen concurrently. There is no (necessary) logical connection between them other than their concurrence. E.g.:
In the mornings, I make breakfast while my wife gets the kids ready for school.
(Note that
while can be used to show a logical relation of
contrast, but that's not relevant to this thread.)
Use
when to show a logical connection between two events. In other words, there is some kind of
dependence of one clause upon the other. E.g.:
Don't kick a man when he's down.
Everyone cheered when she entered the room.
It hurts when I laugh.
Can you hear how in each sentence, the first clause only makes proper sense in relation to the second clause? The first clause is dependent on the second.
So, in light of this difference, as you requested, we can make two sentences using
past simple + past continuous.
I watched TV while the baby was sleeping.
There is no implied dependence here. The two events are unrelated apart from their concurrence.
She crashed when she was trying to go round the corner.
Here there is a clearly implied dependence. In this case the relationship is
causal: I'm implying the reason I crashed.
In my view, cases where the two words may appear to be interchangeable are those where the nature of the relationship is either open to interpretation, vague, or too weak to be detected.