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 ouf the window;
the sun was shining. But it had been raining before.
Had been -ing is the past perfect continuous:
I / we / they / you | had | (=I’d, etc.) | been | doing, working, playing, etc..
he / she / it | had | (=he’d, etc.) | been |(同上)
Some more examples:
When the boys came into the house, their clothes were dirty, their hair was messy, and one of them had a black eye. They’d been fighting.
I was very tired when I got home. I’d been fighting.
When I went to Tokyo a few years ago, I stayed with a friend of mine. She’d been living there only a short time but know the city very well.
You can say that something had been happening for a period of time before something else happened:
We’d been playing tennis for about half an hour when it started to rain hard.
Jim went to the doctor last Friday. He hadn’t been feeling well for some time.
Compare have been -ing (present perfect continuous) and had been -ing (past perfect continuous):
Present Perfect Continuous
======== I have been -ing ======>| | ---------------------------------+---- past now
I hope the bus comes soon. I’ve been waiting for 20 minute. (before now)
James is out of breath. He has been running.
Past Perfect Continuous
======== I had been -ing =======>| | | | ---------------------------------+-----------+----- past now
The bus finally came. I’d been waiting for 20 minutes. (before the bus came)
James was out of breath. He had been running.
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.
Stephanie was sitting in an armchair resting. She was tired because she’d been working very hard.
Some verbs (for example, know and like) are not normally used in the continuous:
We were good friends. We had known each other for years. (not had been knowing For a list of these verbs.)