AoO made easy:
First the rules state that if someone moves out of or through a threated square, but not simply into it, you get an AoO.
You can simplify this by stating if someone exist a threatened square as to move through you enter and exist in the same movement. It is exiting the square that is important.
When Do You Threaten:
A character with a 5' reach and a normal weapon threatens as below:
xxx
xCx
xxx
squares marked x are threatened.
If anyone on the board moves out of any of the squares marked x the character is allow an AoO.