BEFORE you go replacing the fuel shutoff solenoid, do this:
Pull the fuel hose off on the inlet side of the fuel sediment filter/bowl, and MAKE DANG SURE you have good fuel flow on that side. IF it's just a dribble, you have an obstruction in the line between the tank & the bowl, or IN the tank.
Had the exact same symptoms on my current Yanmar about the same number of hours when new. Would start, run a few seconds, die. Then maybe start and run for an hour...then die....start again in a few minutes....maybe run, maybe die....totally random.
Dealer said "fuel shutoff solenoid".....replaced it. No effect. Replaced it a second time.....NO EFFECT.....was going to replace it a THIRD time (what are the odds of 2 bad solenoids ????) when they finally did what I said.....pulled the hose off at the tank....bare dribble of fuel....enough to fill the fuel bowl and let it start, but not enough to keep it running.
They stuck a skinny screwdriver up in the tank outlet fitting and got hosed with fuel.....because there was a wad of plastic shavings (from drilling the hole for the fuel outlet is my guess) along with a bug in the wad that floated over the fuel outlet in the bottom of the tank.....at random.....and shut off the fuel. Cleaned out tank, (drained thru a cloth which is how the wad of crap showed up), cured the problem.
Not saying this is your problem, but the odds of a fuel solenoid failing in 100 hr tractor are a LOT lower than a tank obstruction.....in fact, unless you're using really crappy fuel, the filter in that sediment bowl shouldn't be a problem either in that few hours.
So pull the hose off and see what you get.