Fixing logic for a relay-driven bidirectional AC Motor
One name for it is a 2-pole double-throw relay. The way it is apparently currently connected, it reverses the connections between a pair of wires connected to A1 and B1 and another pair of wires connected to A2/B3 and A3/B2.

For reversing a single-phase AC motor, it would reverse the connections to the main coil with respect to the auxiliary coil. It could also determine which of two coils a capacitor is connected to.

As pointed out by Tony Stewart, another relay is required to start and stop the motor. The direction would usually be selected prior to starting the motor.

Here are reversing circuit diagrams for a permanent split capacitor type (PSC) single-phase motor with either two identical windings or a dedicated auxiliary winding and for a universal motor.



There are other connection variations that could be used, but these three represent the main alternatives.