Two things to check the next time it shuts down. First slowing remove the gas cap, with your ear close by, and listen to hear for the sound of a vacuum. If you hear air rushing in your cap is not venting properly, creating a vacuum in the tank, not allowing the fuel to flow. Two minutes later try starting the engine, if it starts replace the cap. Second, after it shuts down check for spark, no spark means that the coil is breaking down and needs to be replaced. If neither of these is the case, report back, giving us all the engine numbers.