Hi @np_0911
If you wish to try and stay on in Germany, you can apply for a residence permit as the expectant father. If you apply for the permit before the validity of your visa ends, you will continue to be legally here until the decision of the immigration office (Ausländerbehörde). They can issue you with a temporary paper called a Fiktionsbescheinigung to confirm this.
I cannot say how likely it is that such an application will be successful. There is not a clear legal right to a visa/residence permit as an expectant father. Only after the birth of the child does such a right (assuming all the requirements are fulfilled) exist. However, it has been recognised by some courts that a father should be able to come to Germany already prior to birth, in order to help the mother and to bond with the unborn child.
This is also recognised by the German embassies, which offer the possibility to get a visa to come already during the pregnancy. Here you can find information from the German embassy in Peru about it if you scroll down:
https://lima-diplo-de.translate.goog/pe-de/konsularservice/visa/-/2103686?_x_tr_sl=de&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp
As a minimum, you would have to have a recognition of paternity (Vaterschaftsanerkennung) and ideally also shared custody (gemeinsames Sorgerecht). You would also have to show you have enough money to live on and adequate health insurance.
The issue in your situation is that you did not enter German with the correct visa for family reunification. As a result, the authorities would likely reject your application. They would say that while it is possible to have a visa during the pregnancy, then this must be applied for at a German embassy first. The only way I think you could argue against this is if it was close to the expected delivery date or if the mother was having health complications related to the pregnancy and needed your care.
Here you can read an article about such cases:
https://tarneden-de.translate.goog/aufenthaltserlaubnis-bei-schwangerschaft-fuer-werdende-mutter-oder-vater/?_x_tr_sl=de&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp#anc2
If your application took a long time or was paused until the birth of the child, then your right to a permit would be even clearer but the visa issue would remain the same. However, once the child is born, the negative aspects of separation are more profound and the authorities have more discretion to disregard the visa requirement. Here is a case decided by the Federal Constitutional Court about whether requiring the father of young children to leave and go through a lengthy visa process can be considered reasonable:
https://***-migazin-de.translate.goog/2023/12/04/bundesverfassungsgericht-auslaenderbehoerde-darf-visumpflicht-fuer-familiennachzug-nicht-ueberspannen/?_x_tr_sl=de&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp
Please note the links are in English via online translation. As you can probably tell, questions around visa procedures and residence permits before and after the birth of a child are complex. If you wish to try this, then it is important you get some assistance with it.
Best,
Éanna