Change your preferences here.
Enemy Pokémon cannot switch out.
An enemy Pokémon can escape by using Baton Pass or U-turn, or by holding the item Shed Shell. Moreover, if two Pokemon with Shadow Tag are facing one another, both Pokemon may switch out.
In 2v2, Shadow Tag does not affect your partner Pokemon. Shadow Tag has no effect outside of battle.