The proceeding work with the given forms:
I didn't know what he was writing - Я не знал, что (именно) он пишет.
I didn't know when he would call me up - Я не знал, когда он позвонит мне
When he came, we had been waiting for him for a hour - Когда он пришел, мы уже час ждали его.
The firewood had been built into three piles - Дрова были сложены в три штабеля
After all that had been said you may continue doing exercises.