The first thing that comes to mind is warming up and warming down.
The most common reason people get cramps or stiff muscles after playing soccer is because they didn't follow a proper warm up routine.
The importance of warm ups
- They stretch your muscles
- Prepare your heart and lungs for increased activity
- Warm up the connection between nerves and muscles
Warms ups should involve stuff like stretching, jogging, and brief bursts of sprinting. You can also organise "warm up drills" with other players. These are kind of like mini-games and are a bit more fun then jogging, but less vigorous than jumping straight into the action.
The importance of warming down
While warming up is a well known part of the build up to any competitive match, I think it is important to also "warm down".
I say warming down as opposed to cooling down on purpose.
Cooling down might imply just relaxing letting your temperature return to normal after strenuous physical activity.
However, the best thing to do is to actually continue movement, but at a gradually lighter pace.
This is because lactic acid can build up in your muscles when running. To remove it, you'll need to gradually slow down - rather than come to a complete stop.
This could very likely be the mistake you're making, and why your legs feel so stiff and sore.