If you are required to share your retirement accounts with your spouse (or former) as a result of a divorce or legal separation, it should be done based on a court approved divorce decree or legal separation agreement. This allows the amount to be transferred to your spouse’s IRA on a non-taxable basis, and your spouse would be responsible for paying any income tax due on any subsequent distributions made from the amount.
If you give your IRA assets to your spouse under a private agreement, the amount given to your spouse will be treated as a distribution to you. You would then be required to include the amount as ordinary income for the year that the amount left your IRA. Further, the amount would not be eligible to be credited to your spouse (or former spouse’s) IRA.
See definition of Divorce Decree