Affirmative (Positive)
They had been working all day when the boss arrived.
Form: Subject + had + been + verb (ing)
Negative
I hadn’t been working for long.
Form: Subject + had + not + been + verb (ing)
Question (Interrogative)
What had you been doing all day before I called?
Form: Had + subject + been + verb (ing)?