Why does a 1997 ford crown vic 4.6L starts OK and runs for 3 seconds and then it dies but starts right back up and dies again?

There are many possibilities, but from the information given, it sounds like it could be the passive anti-theft system(PATS) might be preventing the vehicle from running.

PATS on that year works by shutting down the fuel pump after about 3 seconds if it doesn't receive the correct info from the key.

Does the theft light blink rapidly when you start the car? If so, you have something wrong in the PATS system. Either the transponder inside the handle of the key is bad, the transciever in the steering column is bad, or the PATS module is bad.