Identification: when the work is not going on but began in the past and there is indication of time. The time of the sentence is past.
1. I had been doing this work for 2 hours.
2. My friends had been coming to my house for weeks.
Helping verbs used: had been
Affirmative: use of had been
1. I had been doing my work for many years.
Negative: use of had not been
1. I had not been doing my work since my injury, but now I am doing it.
Interrogative: use of had at the beginning of the sentence
Had you been going to school before you came here?