Large security deposit paid to landlord & expensed in Year 1 of business (to be used in Year 5 for rent), business closed 2018, sublet money is considered income?

Closed business in 2018, and started subletting in year 5 (most of 2018), where I receive rent from the sublet.

The rent did not go to landlord as it is deducted from the large deposit paid in year 1 until it is depleted.

How is this handled in taxes for 2018...is it considered income just the same?

Also, in 2019 I had to give 1 month's full rent received from sublet to landlord as the deposit had been depleted.  

Not sure how to handle either case for sure.