If you have an agent in two or more queues and those queues have conversations waiting, the agent will be offered the conversation from the queue with the highest priority, starting from 1, then 2 and so on.
To set queue priorities go to Settings > Queues > Edit next to the queue you want to set a priority for.
You can now set a priority for the queue. Queues with a priority of 1 will be offered first, then 2 and so on.
Setting Queue Priority:
In this example, conversations in Support will always be offered to agents before conversations in Sales: