Deductions & credits

I have several houses, that, over the years, I've been unable to take losses due to income limit.  I was just wondering if I could use these unrealized losses to offset a gain on a house.  I recently purchased it with the intent to rent it out but I have a buyer that wants to buy it at a substantial gain.  I'm not using a real estate agent.  It's a cash sale.  I didn't know how long I could own the house before selling it as a rent house.  I assumed it had to be owned and intended for rent for a certain period of time, otherwise, it would be a flip house, of which, I understand the gain would be taxed at short/long term capital gains tax.