He was only ten years old when he composed this poem.

He was only ten years old when the poem was composed by him.
He was only ten years old when the poem has been composed by him.
He was only ten years old when he could compose this poem.
He was only ten years old when this poem had been composed by him.

The correct answer is A. He was only ten years old when he composed this poem.

The other options are incorrect because they do not accurately reflect the meaning of the sentence.

Option B, He was only ten years old when the poem has been composed by him, is incorrect because it uses the present perfect tense, which is used to talk about actions that have happened in the past but have an effect on the present. In this case, the action of composing the poem happened in the past and does not have an effect on the present, so the present perfect tense is not appropriate.

Option C, He was only ten years old when he could compose this poem, is incorrect because it uses the modal verb could, which is used to talk about ability or possibility. In this case, the sentence is not talking about the speaker’s ability to compose the poem, but about the fact that he did compose it. Therefore, the modal verb could is not appropriate.

Option D, He was only ten years old when this poem had been composed by him, is incorrect because it uses the past perfect tense, which is used to talk about actions that happened before another action in the past. In this case, the sentence is not talking about two actions in the past, but about one action that happened at a specific time in the past. Therefore, the past perfect tense is not appropriate.