Another technique is to play team games. Have your child team up with an adult. If your child's team loses, the adult partner can model appropriate ways to behave when you lose. Have the adult partner teach the rules of the game by example. Explain why games have rules.
Rules organize the game.
Rules help everyone understand the game. Spend time playing non-competitive activities, such as doing puzzles, legos, blocks, crafts, etc. These types of activities allow children to learn social skills without the risk of losing. I think it is fine to remind your child how important it is to play fair. I do not think it is a good idea to tell him he will not have friends if he does not play fair.