Contents
Study this example situation:
Yesterday morning I got up and looked out of the window.
The sun was shining, but the ground was very wet.
It had been raining.
It was not raining when I looked out of the window.
The sun was shining. But it had been raining before.
had been -ing is the past perfect continuous:

Some more examples:
- My hands were dirty because I’d been repairing my bike.
- Tom was tired when he got home. He’d been working hard all day.
- I went to Madrid a few years ago and stayed with a friend of mine. She hadn’t been living there very long, but she knew the city very well.
You can say that something had been happening before something else happened:
- We’d been playing tennis for about half an hour when it started to rain heavily.
Compare have been -ing (present perfect continuous) and had been -ing (past perfect continuous):

Compare was -ing (past continuous) and had been -ing:
- It wasn’t raining when we went out. The sun was shining. But it had been raining, so the ground was wet.
- Katherine was lying on the sofa. She was tired because she’d been working hard.
Some verbs (for example, know) are not normally used in continuous forms (be + -ing):
- We were good friends. We had known each other for years. (not had been knowing)
- A few years ago Lisa cut her hair really short. I was surprised because she’d always had long hair. (not she’d been having)
For a list of these verbs, see Unit 4A. For have, see Unit 17