Most factory electric fuel pumps only run for a few seconds with key on, it is a safety issue.
Computer will turn on fuel pump full time when engine RPMs are above 400, engine started.
If there is an accident, roll over or fuel line breaks then engine will stall, 0 RPMs, and electric pump will be shut off computer, so no fuel pumping out to feed a fire
Inertia switch can also cut power to fuel pump if it trips in a sudden stop, another safety feature
So what you see is normal for fuel injected Rangers, 2 second fuel pump run time, but EACH time you turn the key on, so you can repeat on/off as much as you need to, to get pressure in the system up.
If your starter motor is turning the engine over, then do 50/50 test
Spray gasoline or Quick Start(ether) into the intake.
Try to start engine
If it starts and then dies, fuel injectors or fuel pump is not working, or bad gasoline in the system
If it doesn't start then spark is the issue.
50/50 quick and easy