I am trying to use the L298 to control the direction of two motors. the power supply is 12V. If I only connect with one motor, the voltage output is around 4V. However, after I connect the H Bridge to two motors, the output voltage becomes really small.
Show what motors you want to use, what voltage and what current do they need.
Show how you have wired the L298.
Show how you are (trying to) controlling it.
Show what power supply you are using
You might be getting into trouble because the motors need a larger current than your power supply or the L298 can handle.
You should expect a significant voltage drop, but not this much.
Does it matter whether you connect motor 1 or motor 2 ?
And are those motors the same ?