Teams
Teams marks players as friendly by their nametag color.
Settings
Match own nametag
Treats players with the same username color as you as teammates.
Colors
Select any of the sixteen Minecraft nametag colors to mark as friendly, independently of your own color.