The past perfect continuous is used to discuss two past actions, where the first action continues to the second action.
To form the past perfect continuous we follow the formula had + been + verb + ing
Let’s see some examples:
👉 She had been working at that company for a year when she met James (llevaba trabajando…)
👉 I hadn’t been working there long when she quit
👉 We‘d been living in Berlin for three months when we had to leave (llevábamos viviendo en…)
👉 Had you been waiting long before the taxi arrived? (¿Llevabas mucho esperando?)
👉 Her friends had been thinking of calling the police for a few minutes when she walked in