The correct option is D had been waiting
The past perfect continuous form of any verb is obtained by adding 'had been' to the base verb + ing. The verb in question is 'to wait'; for which the base/ root form is simply 'wait'. Applying the above, we clearly get 'had been waiting', which is Option D) - the correct answer. A) is simply past tense; B) is past continuous and lastly, C) is simple present tense.