The past perfect continuous tense (also known as the past perfect progressive tense)
shows that an action that started in the past continued up until another time in the past.
Structure: Subject + had + been + Base form(+ing) + object + time reference
Here's how to make the positive:
I had been living
You had been going
She had been sleeping
He had been working
It had been raining
We had been studying
They had been cooking
To make the negative, just add 'not':
I had not been trying
You had not been working
She had not been crying
He had not been shopping
It had not been raining
We had not been reading
They had not been running
To make a 'yes / no' question, put 'had' before the subject:
Had I been working?
Had you been sleeping?
Had she been reading?
Had it been raining?
Had he been watching TV?
Had we been drinking?
Had they been eating?
To make 'wh' questions, put the question word at the beginning:
Where had I been working?
How long had you been sleeping?
What had she been reading?
How long had it been raining?
How long had he been watching TV?
What had we been drinking?
What had they been eating?
Usage:
Emphasis on duration of action or task that finished in past
I had been learning French for two years before I went to college.
Time expressions (since, for, lately, how long)
He had been drafting a plan for two days before the meeting.