How to implement an alternating current using only two PWM pins on STM32 Nucleo L053R8?
It's quite hard to understand what you want from your question, it's quite "woolly".

However, I will note:


It's not possible to output a negative voltage from a normal microcontroller.
Getting a specific voltage (accurately) from PWM requires good filter design and a feedback system to keep the voltage within bounds.


I say it's not possible to output a negative voltage - that is with respect to ground. Depending on what you are feeding this voltage into you may not need to reference to ground. In this case it is possible to reference the voltage to another IO pin (steady state, output, not PWM). With it set HIGH the PWM pin's filtered voltage will be below that IO pin's voltage and thus appear, with respect to that IO pin, to be negative.  With the IO pin LOW it will appear, with respect to that IO pin, to be positive.

Once you have filtered your PWM signal you will need the output voltage from it to be monitored by an analog input. That can measure the voltage and make sure that your PWM is set to the right duty cycle. Note that the required duty cycle for any one specific voltage will depend largely on the filtering and the load on the output at the time. You will most likely need some form of PID algorithm to constantly adjust the PWM duty cycle. Also remember that your measured voltage will always be with respect to groud, so you will need to subtract your output reference voltage (the output state of your reference IO pin - high or low) from your measured voltage to get the voltage as seen with respect to the IO pin.