Dear @Hadi3390,
Welcome to the Wefugees Community and thank you for reaching out to us.
Your friend can apply for asylum, however, I recommend to discuss his case with a refugee counselling office before (the most specialised would be the so-called "Asylverfahrensberatung"/asylum procedure counselling) to elaborate the pros and cons. They may also support with the application process. My colleague Éanna was answering a very similar question here before. Please follow the link for further details.
If I am not mistaken, your friend can apply in written form if his current residence is valid for more than six months. The BAMF provides a form for this written application.
Am I right and is there anything you would like to add dear @mboen-Éanna or @mbeon-fardeen?
All the best,
Meike