This is more of a legal question than a tax question. The answer is long, complicated, and covers loads of factors you haven't posted. It would take me at least an hour to answer comprehensively. Invariably, at least one other person on this forum would disagree, post an equally lengthy and erudite reply, leaving you more confused than ever.
Any answer posted here must be applicable to anyone in remotely similar situations, and thus answers posted here must be extremely conservative and can not take into account shades of grey or any bits of your personal info you might have unwittingly not mentioned.
If you ask it here, you will not necessarily get the answer you are looking for, and you may unwittingly back yourself into a legal corner where you are stuck with a less-than-desirable result simply because you've laid it all out in black and white on the internet for everyone (the government) to see. If you ask it of a tax accountant or a lawyer in a paid for session, you will get the right answer, specific to you and only to you.