When does a ball score a wicket?

Top view of a ball passing through a wicket from left to right.

Blue is in position to score the wicket.

Although blue is partly in the wicket, it is still clear of the non-playing side. Blue has not yet begun to score the wicket.

Blue has broken the plane of the non-playing side, so it has begun scoring the wicket.

Blue hasn't yet scored the wicket. Even though it is mostly through, it is not yet clear of the playing side of the wicket.

Blue is clear of the playing side. Even though it is still partly in the wicket, it has completed scoring the wicket.