The MA rent deduction only applies to a place that is considered your principal residence. A place that is not your main home (or considered your principal place of residency), and has no rental agreement, doesn't qualify for the rent deduction. However, if you had a rental agreement for those 2 months and it was considered your principal place of residence for those 2 months, you might be able to claim the rental deduction for the amount paid for those 2 months.
See link below for more details
https://www.mass.gov/info-details/deductions-on-rent-paid-in-massachusetts#overview-:~:text=A%20prin...