Note: you can let people stay for free as house guardians, as this is not commercial activity.
The law stipulates that you must obtain permission from the landlord prior to subletting (§ 540 Abs. 1 S. 2 BGB, § 553 BGB) which must be granted if the renter has legitimate interest to sublet. The burden of proof is on the renter.
Subletting individual rooms or the entire apartment to tourists (AirBnB) in the interest of earning money is usually not considered a sufficiently good reason and as such the the decision is at the landlords discretion.
You’ll have better chances if you sublet parts of your parts of your primary residence and can show that you’re long-term traveling for work or that the income is required to make the rent payment or similar interest.
The landlord can increase the rent if they grant permission to sublet.
There are exceptions auch as having your parents or kids move in, but they are very narrow.
Even if you obtain the landlords permit, subletting to tourists may run afoul of legal restrictions.
https://www.mieterbund.de/index.php?id=540
https://www.mietrecht.de/airbnb-untervermietung-was-sie-bei-...
edit: Ah, yeah, I confused who’s the one with the burden of proof, that part was indeed wrong