Playing by the Rules
Rules are an important part of every game, including the ones you'll play with your dog. If your dog doesn't play by your rules, whatever they are, then he doesn't get to play. That being said, disciplining yourself not to continue playing when your dog breaks a rule is probably the hardest part.
Making the Rules
Each game you play will have some basic rules. When excited, some dogs have a tendency to lose self-control and get completely hysterical. Rules aren't there to keep you or your dog from having fun; they're there to keep the fun safe. The rules can be as simple, like, “if a tooth touches human skin, game over” (in fact, that's a good rule to apply to every game you play with your dog). Or, your rules can be more formal, like “fetch toys have to be delivered to the hand, and not dropped until they're asked for.” How simple or elaborate you want the rules of your games to be is up to you, but they should all ultimately include rules that promote safety and deference to people.
Sticking to the Rules
Whatever your rules are, one thing is for sure: if you don't stick to them, neither will your dog. Inconsistency is always the enemy of dog training, so be clear with your dog about whether the behavior he exhibits during play should be rewarded by continuing the game or punished by ending it. Particularly if you choose to play physical or wrestling-type games with your dog, you need to draw clear, consistent boundaries about just how physical your dog is allowed to get, and that level of physicality has to be acceptable to everybody who plays with him. If your dog plays with small kids or elderly people, but also with teenagers, what the kids and elderly can tolerate has to be the limit all the time, even with the teenagers. People that can't play by your rules can't play with your dog, period.

