This is for tax year 2022, California Form 540NR, using the supplied FTB 2022 540NR booklet (revised June 2023). A nonresident who received California-source income files Form 540NR. The booklet says columns A through D of Schedule CA (540NR) compute total adjusted gross income as if the person were a California resident for the entire year, and column E computes income received while a resident plus California-source income received while a nonresident. California taxes income received while the person lived in California and California-source income received as a nonresident.
On the facts you gave—a nonresident, a California personal-residence sale, and a same-year sale of a rental in another state entered from Form 4797—both sales can be in the as-if-resident total if they are in federal AGI, but only the California-source amount belongs in column E. The booklet lists Schedule D-1 as Sales of Business Property, separate from Schedule D, so a Form 4797 rental sale is not automatically a Schedule D (540NR) line. The excerpt does not include the 2022 Part II line 7 or column B instructions, so it does not confirm that subtracting the other-state sale in column B is the correct sourcing entry or that column B is limited to federal-versus-California law differences.
Confirm property location, any California business or apportionment, residency dates, basis or depreciation differences, installment or exchange history, and Form 593 withholding on the California home. Column E changes if the person was a part-year resident or the other-state rental produced California-source income. Drake’s mapping is not in the booklet; match the printed columns to the booklet and the full 2022 Schedule CA (540NR) instructions before filing.