The game is won when there's a path between opposite sides of the board. The player owning those sides is the winner.
Example
In this game Red has built a path between the top and the bottom (which are both red). The path is marked with the numbered stones.
Back to the rules