The court heard that James Allen told a friend that he was dying of cancer on the night of one of the murders.
A friend of James Allen said that he took pity on him, and offered him somewhere to stay the night.
Allen is accused of murdering a pensioner in Middlesbrough last April, as well as a woman in Whitby.
The trial continues.
More top news
Following the Grenfell Tower fire, Thirteen Group has been checking its 20 tower blocks.
A look ahead at the weekend forecast for the Tyne Tees region.
Chantelle Connelly, 27, denies GBH on the 22-year-old she had been speaking to in a Newcastle bar in October