I (or You，He，John，They，Those men) had been studying.
He had been waiting for two weeks. He was still waiting.(有一个表示一段时间的状语)
Up to that time he had been translating those books.(He was still translating at “that time”.)
He had been writing the letter till two o'clock.
He was now thirty years old.He had been gambling since he was ten.(He was still gambling at thirty.)
He had been standing there in the sun.(没有时间状语)
He had been thinking about his marriage.
He came back at seven.He had been waiting for her two hours.(At seven he did not wait any more.)
He stopped swimming.He had been swimming for the last three hours.
He had been writing the novel.(He had not finished it yet.)
He had been studying the meaning of this proverb.(He was trying to study it.)
We had been studying what our enemy had said.(But we were not able to understand it.)
He had been quarrelling with his wife.(lately)
He had been asking me the same question.(Many times)
What had he been doing?(不耐烦)
He had not practised English for many years.(普通说法)
He had not been practising English for many years.(少见)
He said，“I have been speaking to John.”= He said that he had been speaking to John.
He thought，“She was watching me when I passed.”= He thought that she had been watching him when he had passed.