The past perfect continuous (or past perfect progressive) describes an action that started in the past and continued until another moment in the past.
It is often accompanied by an indication of how much time has passed.
The past perfect continuous is formed by combining had been with the present participle:
She had been celebrating.
We had been exercising.
Simply add not:
We had not been paying attention.
Use the regular form:
Had he been smoking again?
Continuous Actions Completed in the Past
They had been studying trigonometry for three weeks already.
We had been swimming in the lagoon when the tsunami struck.
For more information, please see our introduction to all twelve verb tenses in English.