Re: He was sleeping/had been sleeping when...
These words can be used with many tenses and aspects English. Here are some examples with past tense forms:
Originally Posted by rhapsomatrics
He changed before he left.
He left after I arrived.
She washed up while I was finishing my reports.
George looked unhappy when I told him the news.
In the original sentence, when is a conjunction.
During is a preposition.
Please do not edit your question after it has received a response. Such editing can make the response hard for others to understand.