Only unofficial advice is provided here. The Consular Section of the Embassy of the Federal Republic of Germany in your country can provide you with the crucial information you need. It can provide detailed information about the procedure.
Make sure that you mention the relevant purpose of your travel.
On 01/01/2005 the former legal institution of a work permit (“Arbeitserlaubnis”) was replaced by a residence permit (“Aufenthaltstitel”). Generally speaking, you will need a residence permit for any kind of employment in Germany. All work placements are considered to be employment. BUT according to the German Ministry of Foreign Affairs, exceptions do apply if the placement does not last longer than three months for:
1. Placements provided by the Federal Employment Agency as a holiday activity;
2. Placements as part of a programme that is financially supported by the EU or bilateral development cooperation (such as Erasmus+, IAESTE, TEMPUS, etc.);
3. Placements as part of an international exchange programme organized by associations, public bodies or student organizations for students or graduates of foreign universities in agreement with the Federal Employment Agency;
4. Government placements financed from German public funds, EU funds or international intergovernmental organizations;
5. Trainees studying at a foreign* university so long as:
- the placement is study related;
- it takes place after the fourth semester; and
- in agreement with the Federal Employment Agency.
(* “Foreign” here means “non-German” and includes any university in North Africa or the Near East.)
Be aware! An exception to the requirement of a residence permit does not exempt you from the visa requirement !!! These are two separate matters.
If the work placement lasts more than three months, you will need a residence permit regardless of the type of placement.
In any case, it is strongly recommended that you contact the nearest SEMSEM office if you are considering doing a work placement in Germany.