Try this
Enter formula in C2 and copy down
Formula: copy to clipboard
=IF(A2="Germany",LEFT(B2,MIN(FIND({"-",".","/"},B2&"-./"))-1),0)

v A B C
1 Employee location Employee id Output
2 Germany NYHJ-BW.7 NYHJ
3 Germany GEJ.AP-12 GEJ
4 Germany SPJ/LK-84 SPJ
5 Mexico POLSC/LK-7.SW 0