“Generally, when a lessee elects the option to purchase the leased property at the expiration of the lease, tax applies to the sale of the property when the option is exercised. Nevertheless, if the lessee transfers title and registration for a vehicle to a third party within 10 days from the date the lessee acquired title from the lessor at the expiration or termination of a lease it is presumed that the transfer of the vehicle to the lessee was a sale to the lessee for purposes of resale. The presumption may be rebutted by establishing that the lessee made a taxable use of the vehicle prior to the time that the vehicle was resold to the third party.”
As I understand it, you have 10 days to complete the process from the day you receive the title in the mail from the leasing company. The best way to complete this is to get a CDTFA-111 exemption (you will need a signed bill of sale from your friend for this), and then use a REG-262 form (multiple transfers) to transfer the original title from your name to your friend’s name without applying for a title in your name.
The only other important thing to understand is that the odometer disclosure you submit to the leasing company had better match the odometer disclosure you fill out on the REG-262. If they don’t match, it means that you drove the car after you bought it but before you sold it (and thus owe sales tax on the purchase).