Minecraft wiki entry for Target_selectors, associated text: In Bedrock Edition:
[m=<gamemodeName>] — Include only players in the given game mode.
[m=!<gamemodeName>] — Exclude any players in the given game mode.