I am new to UE4, but what I have learned and this might not be the most technical answer, so you can take this advice as such.
You can set up tags, Player Tag, Team 1 tag, Team 2 Tag, and so on, you can assign how AI or players interact with other players and AI on different teams,
So Anything assigns as a player, can be seen as hostile by anyone setup as Team 1 or Team 2, and so on!
You can also set up neutral characters, like civilians by making and assigning these tags to them.
Click on a character you have placed in the world, scroll down in the detail panel, until you find TAGS, from here you can assign and create tags, you have then a few options on how to set up your AI to interact with these tags. Usually, this is done through the Behaviour tree and Blackboard as a sequence, a discovery check, usually done with a preception sight or sound. Then an action or choice, if the AI sees a friendly tag, it ignores it, if they see an enemy tag(Team2) then move to or attack.
I know this is not maybe the complete answer you were looking for, but maybe it will give you some ideas on how to progress forward.
Looking in the AI documentation section should help it explain some of the more advanced parts. As I said, I am fairly new to UE development, so take my advice as such, but I hope it helps!