The given sentence is in the past perfect continuous tense. The past perfect continuous tense shows that an action that started in the past continued up until another time in the past.
The past perfect continuous tense is formed by using had + been + the verb’s present participle (root + -ing).