There are a lot of threads about this. Try searching, you'll find some good explanations. Generally speaking, "while" is used when you want to consider an event as a an activity that goes on for some time, "when" is used when you want to consider an event as a point in time. Unfortunately this is not an easy subject, however learners don't need to understand everything in order to make go
When you have an activity in progress and some unrelated event interrupts that activity, the part of the sentence that expresses the activity in progress can be preceded by while, or the part that expresses the event can be preceded by when. So all of these are possible.
While I was playing with the children, he came home. He came home while I was playing with t
That is, in the subordinate while clause, use -ing; in the subordinate when clause, don't use -ing. Make the main clause with -ing if the subordinate doesn't