This isn’t subaru specific, but i’d be looking for either
- a sensor failure (MAF/MAP/Temp sensor)
- a vacuum leak
MAF/MAP test is easy. unplug it and see if anything changes. If nothing changes, the sensor is probably not working and the engine is in limp mode.
Vaccum leak may be harder to diagnose.
In addition to what @sgtawesomesauce said…
All piston engines need fuel/air/spark. Air needs to be measured properly (hence - check the sensors). Fuel needs to be delivered properly (hence check pressure/injectors/etc.). Spark needs to be strong enough (check coils/plugs, crank angle sensor, etc.).
It’s simply a case of ruling all the things out one by one, start with the most common things to fail on that model