The 98 needs to have the intake tube connected to the MAF sensor, as well as the smaller idle air tube....which has to be connected to the main air intake tube. Without these items, the ECU does not know if air is being ingested or not.
The fuel lines may be reversed and not building any fuel pressure. The fuel line from the filter goes to the top nipple on the motor. The other line goes to the bottom nipple, and the smallest line is a vent, which goes to the middle nipple on the motor.
A less obvious thing to check, would be the crank timing gear. If the replacement motor is from a newer car, it may not be the correct one. It should only have 6-7 reluctors passing under the crank position sensor.
Along those lines, it may be out of time if the person who did the work was not really familiar with Subarus. Often times folks will use the arrow on the crank timing gear as the reference, and it's wrong. Check by putting the hashmark (visible on one of the reluctors) at 12:00 and then look at the cam gears. The top 2 should have the marks at 12:00 and the bottom gears should have marks at 9:00 on the left and 3:00 on the right (looking at the front).
If the cam marks are way out, turn the crank 1 more complete turn and stop on the hashmark, then check again.
Check these things and try it again.