2002 Mercury Mountaineer Engine Problem

The problem is that the engine starts fine, but sometimes it dies right after unless you’re pressing down on the gas pedal. But stil, when I release the gas pedal, it dies right away. It happened about four times this year. Yesterday, it happened after work and a couple of hours later, the engine ran normally after many tries. The next morning, the engine started but died right away. Several hours later, I tried again in my garage and I made the engine run by pressing down on the gas pedal. Several minutes later, something kicked in and the engine ran normally. The “Check Engine” light has not turned on so far. What are the possible causes of the engine dying right after the car starts?