The old man (had retired) by the time the war (was) over.
解析:首先讲一下by the time 的用法
1.表示将来的时间.
主句用将来完成时,而从句用一般现在时来表示将来的动作.
如:I will have finishied the work by the time my father comes back.
2.表示过去的时间.
主句用过去完成时,而从句用一般过去时.
如:He had built a lab for himself by the time he was 12 years old.
鉴于战争结束,所以描述的应该是过去的时间,所以遵从第二条.
希望得到你的采纳!