How do you say

He at last won a competition after three months of training.

..in Chinese?

他在三个月的训练后,终于在比赛中取得了胜利。

tā zài sān gè yuè de xùn liàn hòu , zhōng yú zài bǐ sài zhōng qǔ de le shèng lì 。

How do you say "He had been training hard for the upcoming marathon for the past three months." in Chinese?