
Jared G. answered 03/05/20
Spanish/English Language Tutor, world traveler
D is correct
Your friends started dancing at some point in the past, and that action was still occurring when you arrived to the party. Both you arriving to a party and your friends dancing happened in the past, but since the dancing happened first and was still happening when you showed up, you would say they "had been dancing..."
If you were currently at a party speaking in present tense, you would say "my friends have been dancing for more than an hour.