Optional Rule. When a creature and at least one ally are adjacent to an enemy on opposite sides of its space, they flank that enemy.
Each flanker has advantage on melee attack rolls against the flanked enemy.
On a grid, flanking requires the flankers to be on opposite sides or corners of the enemy’s space.