Hey @Alina105 you have answered your own question 🙂 that is exactly what you should do!
listing 1: whole home including bedroom A and bedroom B
listing 2: private room- bedroom A only
listing 3: private room- bedroom B only
You can create one initial listing and then duplicate it twice, and make the particular adjustments to each listing so you don't have to make 3 listings from scratch, because all 3 will have lots of the same/similar info: address, amenities, house rules, some pics etc