Fix and flip investment as a real estate professional

I bought 2 homes. One home is my primary and a duplex. I rent half and claim half the deductions as a rental business. I also claimed loses on it for extensive renovations on the rented side. On the other home, I purchased and held for a year. The income accrued off it was less than the losses made on the duplex. Thus I owe no taxes for that tax year. I am assuming I can still claim the 500k credit for a married couple on the duplex since it is my primary residence. Is this correct? This is spread out over multiple years fyi. ie 5 years