Dear Ilyas Ahmad,
Welcome to the Wefugees Community and thank you for sharing your question.
Marrying in Germany is a quite popular and much discussed topic on this platform. Therefore, we published a blog, which provides infos on the procedure and the required documents. Please follow the link accordingly.
As you have a legal residence in Germany (an "Ausbildungsduldung", I assume?), once you hold all the necessary documents, marrying a German citizen should not be an issue for you.
Would you agree @mbeon-Bernd or @mbe-on_Zsigó?
I hope this helps and please feel free to get back to us with any further questions.
All the best,
Meike