Staff are the owner and the moderators
The bot compares members with the server owner and with people who have moderation permissions: ban, kick, timeout, delete messages, manage the server. Roles that are allowed bot actions in "Moderation" also count as staff. The bot does not check people from staff.