Tom said that he was doing his homework now. When reporting this statement, we would say "Tom said that he had been doing his homework then." Reporting statements involves changing the perspective from the original speaker to the person reporting it. This involves changing pronouns like "I" to the speaker ("he" in this case), changing verbs to the past tense, and changing references to times or places.