Have you checked for recalls on your model year. I have a f350 2001 and it did the same thing until I had my cam position sensor replaced works fine now.
it has to be a relay or ignition problem
The Ford F150 cranks and immediately stalls and shuts off. It will crank again, but it shuts off. The guages move back and forth also
If this is the remote start system, it shuts down the engine for security.
iec
you need to replace the cam shaft positioning sensor
Turn it back on and continue driving?
The most probable answer is poor maintenance.
O2 sensors ?
Clogged fuel filter.
it will randomly stall at the stop light
check for cracks on any vacum lines.
no