The correct option is D He had been drinking
Here, 'He had been drinking' in past perfect continuous is correct because it
is used to indicate an action in the past that began before a certain point in
the past and continued up until that time.
'Had been drinking' is incorrect because of the missing subject (he).
Usage of 'drinking' and 'been drinking' is grammatically incorrect.