Opportunity Attacks

Combatants are constantly watching for a chance to strike a foe who is fleeing or passing by. Such a strike is called an opportunity attack.

You can make an opportunity attack when a creature you can see moves out of your reach (see below). To make the opportunity attack, you use your reaction to make one melee attack against the provoking creature. The attack occurs right before the creature leaves your reach.

Determining Reach: If you have more than one reach (for instance, if you are holding a lance in one hand and a dagger in the other), your "reach" for the purpose of this rule is the greatest reach with which you can make the melee attack.

Avoiding Opportunity Attacks: You can avoid provoking an opportunity attack by taking the Dodge action. You also don't provoke an opportunity attack when you teleport, or when you are moved without using your movement, action, or reaction.