Had
you been waiting there for more than two hours when she finally arrived? (общий)
How
long had you been studying Turkish before you moved to Ankara? (специальный)
Who
had been waiting for three hours to get on the bus? (к подлежащему)
She
had been working at that company for three years when it went out of business, hadn't
she? (разделительный)
Had
James been teaching at the university or at school for more than a year before
he left for Asia? (альтернативный)