German here, there are a bunch of "buts" worth mentioning, before everyone mistakes our country for a socialist utopia:
For starters, the notice period for employee and employer are identical, mutually agreed upon, and can be 1-6 months. If the OP was fired with 3 months notice, that simply means he would have to give equal notice when resigning. Usually it's however expected to work all through the notice period and not just relax at home.
Secondly, a compensation is voluntarily, unless being fired due to socio-economic circumstances (as opposed to bad performance). In such a case, 1 month compensation per 1 year worked is often recommended by labor courts (maxing out at 6 months). Again, those are not mandatory unless it goes to an arbitration tribunal or court.
Thirdly, being allowed to take classes or other further education measures typically only exists for elderly layoffs with limited chances of finding qualified employment, or people with very limited skillset. Again the only exception is when being terminated due to socio-economic reasons, where the company agrees to pay development measures as part or in lieu of a settlement.
Unemployment benefits apply once the employee has paid social security contributions for minimum 12 months without interruption. In the first year they are due to receive 70% of their former salary after tax (there's a cap though, I believe it was 2800 EUR/month).
If they still didn't secure a new job, they are entitled to receive 484 EUR plus housing (based on actual cost; again capped and with a size restriction, I believe it was max. 20m² per person in the household). To qualify for this second stage of benefits however, the person must not have any assets exceeding 10k EUR, else they'd have to use those up first).
Medical insurance however is available all through without any caveats.