Thank you for your question and for sharing your story with us!
If I understood everything well, you already have a residence permit due to your marriage with an EU-citizen. Your wife and you are expecting a boy next month. He will get the German nationality because your wife has been established in Germany for more than 8 years.
Now you would like to know when you will be able to apply for permanent residence or for the German nationality. Please let me know if there is anything I understood wrong!
1. Concerning the permanent residence (Niederlassungserlaubnis):
As @Nilab explained you in your previous question, you can usually apply for it after 5 years continuous residence in Germany, under certain conditions (sufficient income, level of German, etc.). However, if you have a German child, the conditions are slightly more advantageous: you can apply for a permanent residence already 3 years after your son was born, if you are living with him and are holding a valid residence permit (§28 Abs. 2 AufenthG). Please note that the conditions of sufficient income and German level (B1) remain the same.
Here is an example of the conditions and the necessary documents for such an application (this is for Berlin; depending on the city you live in, the required documents may slightly differ).
2. Concerning the German nationality:
You can usually apply for naturalization after 8 years living in Germany. However, there is following exception: if your wife applies for a naturalization, you can apply with her before 8 years residence. This is called a derivative naturalization (Miteinbürgerung) and is the result of §10 Abs. 2 StAG. Here are the other conditions you need to meet to get naturalized, as listed on the BAMF website:
- You have an unrestricted right of residence at the time of being naturalised,
- You have passed the naturalisation test (knowledge of the legal and social system, as well as living conditions in Germany),
- You have been living in Germany with a residence permit for eight years (this period can be reduced to seven years if you attend an integration course successfully, and can be reduced to as few as six years in the case of special integration measures) -> except in the case of derivative naturalization
- You have independent means of securing a living (including for family members entitled to maintenance) without resorting to welfare payments and unemployment benefit II,
- You have adequate German-language skills,
- You do not have any convictions on account of a criminal offence,
- You are committed to the free democratic constitutional order of the Basic Law of the Federal Republic of Germany, and
- You have lost or given up your former nationality (exceptions apply with regard to this point, depending on the country of origin; please contact the naturalisation authority)
As you probably noticed, for both procedures, it is very important to have good German-language skills, which you can acquire by visiting a course at the Volkshochshule for instance.
I hope this helps you. Don't hesitate to add a comment if you need further information!
All the best,