I'm not a Subaru expert, but some reasons for stalling include a dirty TB, bad cam/crank sensors, bad IACV, clogged fuel filter...
You said leaving the key to the run position for 30 sec helped it start, which may indicate a fuel issue.
Is the CEL on? When you turn the key to run, do you hear the fuel pump prime?
Last edited by mclasser; 12/11/17 11:32 AM.