The rule is any USED vehicle and out of state emission certified vehicle which is equipped with the necessary Federal Emission Components is eligible for California registration as long as the vehicle pass a smog check in California. The vehicle's emission system must not have a tamper and all emission components function properly. This exemption does not apply to new vehicles.
Since your 2004 Subaru Forester is considered is a used vehicle, it is eligible for California registration as long as it passes California's smog inspection. Late model vehicle (2000 & newer) do not have the tailpipe emission portion of the smog check administered, and need to only pass an OBD-II systems check and visual inspection. With that said, the most important thing is to make sure your Subaru's check engine light is not illuminated. If the check engine light is not on (except when the ignition is in the ON position), and there aren't any trouble codes stored in the engine computer, your Subaru has a good chance of passing the smog check in California. As mentioned, there is no tailpipe (exhaust) emission test for 2000 and new gasoline powered vehicles. If the engine computer system is functioning properly and the check engine light (or Malfunction Indicator Lamp or Service Engine Soon Lamp) are not illuminated, the chances of passing are good.