Step 1: Understanding the Context of the Sentence.
The sentence describes an action that was happening in the past and was interrupted by another event. The phrase "when it suddenly started to rain" suggests that the action of playing tennis was ongoing at the time the rain started. This points to the past perfect continuous tense, which is used to describe an action that was happening continuously before another past action interrupted it.
Step 2: Analyzing the Options:
Option (A) "have been playing" is the present perfect continuous tense, which indicates an action that started in the past and continues into the present. Since the sentence is referring to a past event, this is not correct.
Option (B) "had been playing" is the past perfect continuous tense, which correctly describes an action that was happening continuously in the past before another past event (the rain) interrupted it. This is the correct choice.
Option (C) "would have been playing" is a conditional perfect continuous tense, typically used to describe hypothetical situations or actions that would have happened under different conditions. This is not appropriate for the sentence.
Option (D) "could be playing" suggests possibility in the present, which is incorrect because the sentence is referring to a past event.
Therefore, the most appropriate option is (B) had been playing.