mercs will kill anything that attacks you or you attack.only wont attack if you say dont attack me or my friends. or set to kill everyone but me and faction members.
That option is bugged even if you got somebody tagged green and they also have you tagged green they still attack. Its best to do mercs with somebody added to same base.
I suppose "dont attack friends" isnt about tagging someone green, but about setting friends in your faction terminal