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
The deck of the New Wear Crossing has slowly been pulled into place marking the latest major milestone of the engineering project
Friends and family of Bradley Lowery watched as the youngster led England out at Wembley with his hero Jermain Defoe
Police in North Tyneside and Northumberland are responding to concerns raised by local communities by tackling anti-social behaviour.