If I convert my rental home to my primary residence how long do I have to live in it so I do not have to recapture depreciation and pay tax on the capital gain?

I converted my home to a rental in 2011. If I move back in for at least 2 years will I have to recapture depreciation? Will I have to pay tax on the capital gain?