Ok so just to get this into some sort of order:
So.....legally, you should wait until D's tenancy runs out, which should hopefully be in 2 months' time. There's no real reason to get rid of him. By all means call the police when he's doing drugs. Or if it's that bad, move out yourself.
By midday D’s friends were still in the house, now in his room and quieter but they were still going through living room to get to kitchen and this annoyed B, she went to D to ask him to get his friends to leave.
Why should his friends leave just because you don't want them there?
they had gone back home with about a group of 15ish people to have some drinks back at the house (this was about 2am)
And I guess B and her 15 friends would have been as quiet as church mice? Why is B allowed to have 15 friends over at 2am but D isn't allowed 12 at 11pm/3am?
TBH you sound as bad as each other. It's his home too and yes, he shouldn't be partying loudly until 4am but this seems to be the first time he's done that in 4 months.