|HAD BEEN + PRESENT PARTICIPLE
(past perfect of be + ing-form)
|I had been waiting for you for hours when you came.
He had been reading a book all morning when I called him.
After he had been waiting for more than an hour, he left.
|This form is clearly a combination of
the past perfect (= past perfect of be)
and the continuous (= ing-form of the verb)