So if you, in good faith, believe your friend to be a Texas resident, then you may sell him a handgun.
In TEX. ELEC. CODE ANN. § 11.002, residence is defined as follows:
§ 1.015. Residence
(a) In this code, “residence” means domicile, that is, one's home and fixed place
of habitation to which one intends to return after any temporary absence.
(b) Residence shall be determined in accordance with the common-law rules, as
enunciated by the courts of this state, except as otherwise provided by this code.
(c) A person does not lose the person’s residence by leaving the person's home to
go to another place for temporary purposes only.
(d) A person does not acquire a residence in a place to which the person has come
for temporary purposes only and without the intention of making that place the
person's home.
(e) A person who is an inmate in a penal institution or who is an involuntary
inmate in a hospital or eleemosynary institution does not, while an inmate, acquire
residence at the place where the institution is located.