Dear @Asim9091,
Welcome back to the Wefugees Community and thank you for your question.
I think your friend's situation is very complicated and if I understand correctly, he was living "illegal" in Germany in the last years. I have my doubts that the immigration office will simply issue him papers when he shows up. It might be the best to get individual counselling in a refugee counselling office before to discuss his options. These offices (i.e. by Caritas, Red Cross or Diakonie) offer free of charge and confidential counselling and your friend does not need to worry about contacting them. Your friend can try fo find counselling with this search engine, for instance.
I hope this helps and all the best for you and your friend,
Meike