Life Estate family member passed but I own house

A number of years ago my mother in-law's (MIL) health was declining so we jumped at the chance to buy the little house right next door. My MIL kicked in the proceeds from the sale of her condo, we refinanced our house to cover all the rest. After the lawyers were done the deed was in our living trust's names and my MIL had a Life Estate (LE) clause on it. I did all the upkeep maintenance, etc. and she paid the utilities and spent the rest of her SS income and saved very little. She passed away 12/29/2022 with little to her name. We down sized into that house and put ours on the market. It didn't sell, so after 9 months we put the little house on the market and sold it in under 2 weeks, so moved back to our former house.
There is a gain on the little house sale. With all these complications I have no idea if I have any deductions or not. Because of the LE for my MIL does the 2 of 5 year waiver work, and if so how to use it? If not is there anything I can deduct above the actual basis?