try the CPS (cam position sensor) on the front cover just below water pump. A very common PSD part that does exactly what you're describing when it goes bad.
X2 Cam sensor is almost always the problem most ford dealers stock them due to their frequently going bad