You are probably referring to Section 1035 fo the Internal Revenue Code that allows you to exchange out of one annuity and into another annuity. You are not permitted to exchange from real estate into an annuity.
There is a relatively new strategy out there referred to as the Structured Sale, which involves an annuity. This strategy is not an exchange. It actually triggers your gain, but you defer it over a period of time using an annuity. There is no IRS guidance on this structure, so be careful.