Selling your California home and leaving the U.S. does not automatically terminate your California residency. California uses a "domicile" standard: you are a resident if you have a true, fixed, permanent home in the state and intend to return. Residency hinges on physical presence, intent to remain, and maintenance of ties (e.g., driver's license, voter registration, bank accounts).
For definitive guidance, consult the California Franchise Tax Board.