The answer to that question is, “it really depends”. It depends on your endurance level, on your stamina, on your work out, on your diet, on your overall metabolism.
Give yourself enough time. There are virtual races where people race against each other in a treadmill etc. If at all you want to run, use a treadmill and run for some time. You can take enough breaks in between. Virtual races have changed the way you look at competition for a marathon or a race.
There’s no definite rule on how much you should wait but it’s advisable to wait for a month before you want to race again. Running a marathon puts a lot of stress on your body. You should give your body proper rest and adequate time to get re-energized before running again.
Experts suggest that you should wait at least 2 days for each mile you run before racing again. Say you have run a total of 5 miles, and then you should wait for at least 10 days before running again.
If you want to continue easy cycling or swimming, it’s fine. Your body needs the time to heal. Try to avoid strength exercises for your lower body as it might result in further damage of your muscle tissue. Give your body enough time before putting an extra effort. Remember, body is your temple. If you don’t take care of it, it will act against you.
There are many stories where a runner has hurt him time and again because he didn’t take enough rest after running a half-marathon.
Sometimes people feel that when the soreness reduces or they have regained the strength in their legs, they go out for training. It’s often a big mistake for most runners.