Sorry but you’re all backwards. The only headgasket problem motor is the DOHC 2.5L. The SOHC motor fixed this problem and they do not have headgasket issues. Infact I’ve never heard of an SOHC EJ25 ever having to replace the headgaskets.
Moving on to the next problem, the 96-99 Outback (automatic) 96-99 Legacy GT, the 98 Forester, and the 98 Impreza 2.5RS are the only vehicles that had the DOHC motor.
The 2.2L is definitely one of the more “bulletproof” of Subaru engines, albeit fairly anemic in the power department. The DOHC 2.5 that has had its headgaskets replaced (more likely than not with the updated gaskets to resolve the issues) is a good choice too. If you find a DOHC that doesn’t have documented gasket replacements, stay away.
For what you want to spend, you should be able to get any Impreza L wagon, early Outback or Legacy (non-GT) with ~100k or less. You might even be able to find a 98 RS or Forester with new headgaskets and a lot of miles.