It is used to express an action in progress before another action in the past:
I had been reading a book before I left my house.
She had been studying for hours when she fell asleep.
It is used to express an action in progress before another action in the past:
I had been reading a book before I left my house.
She had been studying for hours when she fell asleep.