A homeless man has been named in court after allegedly breaking into the home where an elderly great-grandfather was later found dead.