We use the past perfect continuous (had been + -ing) for an activity that went on for some time before a moment in the past, often with a result we could see: She had been waiting for an hour.
coral = the form we learnunderline = the word that decides it
Pattern
Examples

She had been waiting for an hour when the bus finally came.

His clothes were dirty. He had been working in the garden.

The streets were white. It had been snowing all night.

They had been walking for hours, so they were tired.

Her eyes were red. She had been crying.

We had been living in Boston for five years before we moved.

I had been studying all evening, so I went to bed early.

The children were out of breath. They had been running.
Remember
- Had been + -ing is the same for everyone: I had been, they had been.
- It often answers *how long*: for an hour, since morning, all night.
- It explains a result in the past: red eyes, dirty clothes, wet streets.
- For states like know and like, use the past perfect: I had known him for years.
Check yourself
Choose the right word. You'll see why after each answer.
He was tired because he ___ all day.
✓ He was tired because he had been driving all day. An activity that went on before a past moment: had been driving.
We ___ for two hours when the rain started.
✓ We had been playing for two hours when the rain started. For two hours before the rain started: had been playing.
I ___ him for years before we became friends.
✓ I had known him for years before we became friends. Know is a state, so we use the past perfect: had known.
Her hands were covered in paint. She ___ the fence.
✓ Her hands were covered in paint. She had been painting the fence. The paint on her hands is the result of an activity: had been painting.
How long ___ you been waiting when the doctor called you?
✓ How long had you been waiting when the doctor called you? Before a past moment (the doctor called): had you been waiting.
What next?
Keep going: pick your next step
Next rulePast Simple and Past Continuous in StoriesIntermediate · B1
Read a storyThe Ransom of Red ChiefIntermediate · B1
Learn an idiomI'm Busy! Idioms for Being BusyIntermediate · B1
Learn new wordsHousework VocabularyIntermediate · B1
Popular hereVerbs with Prepositions followed by GerundsIntermediate · B2
Popular herePrepositions of Travel and MovementIntermediate · B1