I understand property A is my primary residence for this time.
For what time specifically, and why do you understand it that way?
When you say you moved from A to B, I am assuming that included "everything", meaning that you moved with the intent of saying in property B and establishing it as your primary residence with no intent of going back to property A. You notified the post office of your change of address, the water company, electric company, gas company, credit card companies, etc, etc, etc.
On 1 Aug 2020 or earlier property B was converted back to personal use, as you moved in on that date.
On 2 Aug or after, property A was converted to rental property with an "in service" date of the first day a renter could have moved in. That in service date will without question, be a date "after" Aug 2.
I am confused on how to handle the P&L
Deal with each property on the SCH E of your 1040 one at a time, "AS IF" the other property does not exist, and never did exist. Mixing the two together will drive you insane.