Past perfect continuous
had + been + gerund (verb + ing)
We use the past perfect continuous to talk about an action that occurred in the past and continued up until another time in the past (the past before the past). You can use an expression of time to express the duration of what had been happening.
I had been doing my work when my boss came in.
She had been waiting a long time before catching her train.
Maria had been seeing her boyfriend for two years before they broke up.
It is common to use the past continuous to talk about a reaction, cause or effect of something in the past.
Anne was very sick because she had been eating too many fast foods.
All the employees were exhausted because they had been working the whole day.
They were all sick and tired as they had all been feeling the effects of the crisis.
Past perfect continuous vs. Past continuous
Past continuous was/were + gerund (verb + ing): Generally speaking, we use the past continuous to talk about an action in the past that is interrupted by something. We, therefore, use the past continuous to emphasise the ‘something’ that is being interrupted.
eg, She was cleaning her house when her friend rang the doorbell.
We were helping our friends with their homework yesterday when Sam came in.
It is not obligatory to have an interruption, only that the past continuous is used to emphasise an interruption:
eg; I was playing football yesterday.
Past perfect continuous had + been + gerund (verb + ing): Is generally used to emphasise a period of time in the past before the past. Therefore, it’s more acceptable to use time expressions such as; for three hours, since Tuesday, Since last year, for five days etc. Moreover, the past perfect continuous is used to show the reaction or effect of something rather than the past continuous.
I had been flying over Scotland when my dad called.
You had been living in Spain for three years before you married your wife.
She was sick because she had been working outside all day in the cold.
INCORRECT: I was helpless that day because I was working without motivation.
CORRECT: I was helpless because I had been working without motivation.
(‘I was helpless’ is the reaction and it needs to precede the past perfect continuous).