Selling Primary with In-Law

Hi guys! We are considering selling our primary residence (ownership 13 years) and the property has an in-law apartment that has been rented for the last 3 years at around $1,200 per month. Do we still qualify for the 500k capital gains exemption as a married couple for the full property or would 1/3 of the capital gain be taxed (1/3 of the property is the in-law sq footage)? That would seem excessive since it’s only been rented 3 years out of the 13. Thank you!