Minecraft wiki entry for gamemode, associated text: Specifies the target(s). If not specified, defaults to the player who executes the command.
Must be a player name, a target selector or a UUID‌[Java Edition only]. And the target selector must be of player type.