The tax law gives the custodial parent the right to claim the exemption for a child as long as the child does not provide more than half of his/her own support. However, that parent can waive the right by signing Form 8332 and awarding it to you as long as you lived apart for the last six months of the year. If the final divorce decree awards you the exemption but gives physical custody to your spouse, you’ll continue to need this form unless the custodial parent permanently waives the right to the exemption.
The length of time that an asset is owned and that generally determines long- or short-term capital gain treatment.