How long I need to own a rental property b4 i have to pay capital gains taxes?

I’m selling my 2 bedroom home on a REC contract after owning it for 5 years. I’ve heard that unless you own for 1 year, you will not have to pay capital gains taxes.

Also, i’m wondering if i can still write off my taxes and interest still, since the loan will stay under my name.