The Past Perfect expresses the idea that something occurred before another action in the past. It can also show that something happened before a specific time in the past.
You had studied English before you moved to New York.
Had you studied English before you moved to New York?
You had not studied English before you moved to New York.
PPC:[had been + present participle]
We use the Past Perfect Continuous to show that something started in the past and continued up until another time in the past. "For five minutes" and "for two weeks" are both durations which can be used with the Past Perfect Continuous. Notice that this is related to the Present Perfect Continuous; however, the duration does not continue until now, it stops before something else in the past.