2012 Forester X Auto
I'm assuming that the issue is the car cranks normally, but the engine doesn't run, it just keeps turning over. It's not entirely clear from your description.I have a 2010 Subaru Forester and have been having intermittent starting issues for 2 months. The car turns, clicks, and makes all of the noises you would expect to start but it does not start.
It would likely help if you answered @Dogs question above.
So, if you are cranking the car but it doesn't start, try this:
Turn the key off, pull out the key and wait at least 10 seconds.
Put in the key back in and turn on the ignition, but don't turn the key all the way to where it starts cranking.
Wait for 10 seconds.
Turn the key to engage the starter. It should start, as I'm thinking it is your engine immobilizer, as I had a Subie that acted the same way.
Good luck and report back.