See also: Character Combat
If you are making a melee attack against an opponent and you have an ally on the other side of an opponent so that the opponent is directly between the two of you, you are Flanking that opponent.
You gain a +2 Flanking bonus on your melee attack roll (you don't gain a Flanking bonus when making a ranged attack). See the diagrams below for examples of Flanking.