If you file for bankruptcy, what happens to your rental or other investment property depends, in large part, on whether you file for Chapter 7 or Chapter 13 bankruptcy.
In Chapter 7 bankrputcy, the homestead exemption does not protect nonresidence real estate. So if you have equity in the property, you may lose it.
In Chapter 13 bankruptcy, you keep your property, including investment real estate. And you may be able to reduce the amount of the loan in certain situations. But the income from your investment may increase the amount of your monthly payment to the bankruptcy trustee.
For information about real estate you live in, see Your Home in Bankruptcy.