Flanking is done by having being on opposite sides of an enemy. like this Ally | Enemy | Ally.
flanking gives you combat advantage over the enemy.