Two in the area, not three
It is a violation to have three players of the same team inside their own goal area at once — but only while the ball is in play in their half.
The goalkeeper counts towards that number. The limit is two, goalkeeper included.
The opponents get an indirect free kick there. If it denied a clear scoring chance, a card can follow.
This app also counts a teammate who has gone fully over the goal line, behind the goal.
That is not in the Laws. Without it, a goalkeeper could get around the limit simply by backing out behind the goal.
A serious foul inside your own goal area — ramming an opponent, handling the ball, and the like — is a penalty kick. Only while the ball is in play.