Minecraft wiki entry for Target_selectors, associated text: Filter target selection based on teams. Arguments testing for equality cannot be duplicated, while arguments testing for inequality can.
[team=<teamName>] — Include only targets in the given team.
[team=!<teamName>] — Exclude any targets in the given team.
[team=] — Include only targets not in a team.
[team=!] — Exclude any targets not in a team.