Deductions & credits

One more thing (sorry!) in response to one of your followup questions, you don't lose the exclusion if you own the house longer than 5 years.  2 years ownership/2 years residency is the minimum, but you would certainly qualify if you lived there (as your main home) for as long as you want past the minimum.