Hi @Mehdi275 ,
Absolutely! If you fully disclose that with your listing, have the place extremely clean and ask for a reasonable rate for the rooms, it would be no different than a hostel, which many of college students touring, or even my Mom in her 70's went that route to save money.
My niece stayed in an AirBnB in Manhattan which 4 guest shared a large single studio apartment with 1 bath.
Have great pictures, make sure the shared bath is prominently shown and I think you will be fine.
AirBnB has a pretty solid reputation for safety of guests and hosts. Of course you will read and hear about the outliners but for the majority of the time most trust the AirBnB brand.
You might want to consider was your have your listing to ask the community to critique your listing.
Good luck.
Bettye6