The Past Perfect Continuous

We use the past perfect continuous when there are 2 actions in the past. The first action lasted a long time and we use the past perfect continuous to describe it. The action stops when the second action takes place. For the second action we use the past simple.

had been living in Italy for 3 years before I went to Rome.
I‘d been watching television for half an hour when I fell asleep.

Look at the construction:

Subject

had

been

-ing form of verb

I

had

been

sleeping

for 2 hours when the phone rang.

They

had

been

waiting

for an hour before she arrived.

Look at the question form:

Question word

Auxiliary

Subject

Verb

How long

had

you

been sleeping

when they woke you up ?

I’d been sleeping for 2 hours.

How long

had

you

been going out together

before you decided to get married?

We’d been going out together for 6 months.