Auto-translated
So, as you rightly pointed out, elementals and ghosts never join your army.
Regarding other units, here's the situation:
When a map is first loaded, monsters of two types are generated: those that can be recruited for gold and those that can be recruited for free. If the number of monsters is initially set to a specific number, they can only be recruited for gold. This also applies to monsters that have already participated in battles.
The conditions for recruiting units for free are:
1. The monster type must be one that can be recruited for free.
2. The hero must have available space in their army (or identical units).
3. The hero's army strength must be at least twice the strength of the units being recruited (strength is calculated based on the computer's rating).
To recruit units for gold, the following conditions must be met:
1. The units must be of the appropriate type (i.e., those that can be recruited for gold).
2. The hero must have the "Diplomacy" skill.
3. The hero must have enough gold to pay for the entire unit.
With basic Diplomacy, 1/4 of the unit is recruited; with advanced Diplomacy, half of the unit is recruited; and with expert Diplomacy, the entire unit is recruited. However, you will always have to pay as if for the entire unit.
If the recruitment conditions are not met, and the hero's army is at least five times larger than the unit (according to the computer's rating), the unit will try to flee.