Does it ever stall while driving it?
The next time it won't start, try this... cycle the ignition switch on-off-on (not to the Start position) 5-6 times in a row to give the fuel pump plenty of time to get fuel up to the fuel rail next to the fuel injectors. If it starts right up, odds are very good your problem is from a leaky valve inside the fuel pump/fuel pressure regulator.
If that doesn't help, I'd be suspicious of the CKP sensor which is the Crankshaft Position Sensor which is mounted on the transmission/driver's side next to the flywheel. The CPS is what generates the engine's master timing signal & if it doesn't, the engine won't start. Which is why I also asked if the engine has ever stalled which is another symptom of a bad CPS.
If it has never stalled, I'm thinking more fuel pump/fuel pressure regulator assembly which is mounted on the gas tank.