A. He was only ten years old when the poem was composed by him.
B. He was only ten years old when the poem has been composed by him.
C. He was only ten years old when he could compose this poem.
D. He was only ten years old when this poem had been composed by him.
✅ The correct answer is option A.