If I owned and rented out a duplex do I qualify for the capital gains tax exclusion for the whole home or just the half of the house I was living in?

I purchased the home 4 years ago and lived upstairs the entire time while also renting out the basement the entire time. I know I qualify for the capital gains tax exclusion on the sale of the home (we lived in it for at least 24 months). But when entering in my sales information, turbo tax is still charging me a capital gains tax. Does that mean I still have to pay the tax on 50% of the sales gain because it's a rental as well as my primary residence?