Yes, if you meet the two out of the last five years, you can take advantage of that exclusion HOWEVER since it was a rental, any depreciation you took is subject to "Depreciation Recapture".
Depreciation Recapture is when the depreciation taken (or could have been take) is regained when you sell.
For example, you purchased a home for 100,000 and the depreciate over three years is 11,000. Then you sell for 150,000. The capital gain of 50,000 may be excluded, but you will have 11,000 depreciation recapture which is reported as ordinary income and taxed at your tax rate.
Does not matter if you claimed that depreciation or not, it's recaptured as if you took it.
IRS link
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"