Homeowner's exclusion

If the taxpayer rent half of his home and reside in the other half, then he sold the whole home, does the exclusion(exclusion of gain upto 250,000) applied on half the home or whole home or not applied at all ? Thanks.