There is state of unit that allows it to be untargetable, it works for all however. You could try to create a trigger that shots when player is selecting a unit, checking what player is that and unselecting it for him, the only flaw is that unit is visible for fraction of second anyways.
Will try it out, thanks. Players 1-4 are allies and they are supposed to protect a certain unit so making it untargetable will prevent teamkilling. Player 5 is a hero that i supposed to singlehandedly kill that unit.