Everyone needs somewhere to live. It is a basic human right, however, finding a place can be more difficult. Hopefully, if you were inside for just a short sentence, your home will still be there waiting for you or perhaps your partner and children are still living there. If, however, you lost your home and possessions when you went inside you will need help.
Usually the prison service is helpful in putting you in touch with the correct agencies whilst inside. I heard of some who had dropped through the system and I disbelieved those who were intending going to live back on the street in cardboard city, but maybe they were! That says something about the society we are. Whilst inside talk to your probation officer and local authority representative. The local authority has a duty to find you somewhere to live if you are genuinely homeless. If all else fails the Salvation Army will find you a bed for the night. Shelter also advises on homelessness.
If you have been inside for a long sentence you will not be released until you have somewhere to live and certain categories of prisoner will remain under supervision.