You have two sides, one out in the field, one in.
Each man that's on the side that's in goes out and when he's out he comes in and the next man goes in until he's out.
Sometimes you get men still in and not out. If they score, they come in.
When three men are out, those that are in and still out are left out and don't score. Then the side that's been out comes in and the side that's been in goes out and tries to get the side coming in out.
When both sides have been in and out nine times, that is the end of the game. Unless, of course, both sides have the same number of not outs, not counting left outs. In that case, they continue to go in and out until after an equal number of ins and outs one side has more.