Generally, if you transfer your home to your spouse or ex-spouse, you’re not considered to have a gain or loss and it’s not a taxable event. The sole exception to this is if they’re a nonresident alien. If that’s the case, the tests laid out here will help you determine if you can exclude any gain.