A. I had been waiting for the bus, and it arrives.
B. He is going to the market yesterday.
C. She will finish her homework before she went to bed.
D. They were playing football when it started to rain.
Explanation
The sentence with the correct tense and sentence structure is: They were playing football when it started to rain.
This sentence correctly uses the past continuous tense ("were playing") to describe an ongoing action that was interrupted by another action ("started to rain").