彼はよその人には冷たいが、友達には優しい。
He is cold to outsiders but kind to his friends.
他人 is a more general term for 'another person' or 'stranger', often used in legal or formal contexts. よその人 emphasizes the person as an outsider from a specific group or family.
知らない人 simply means 'a person one does not know'. よその人 carries a nuance of being from outside one's own circle, not just unknown.
Most common spelling; uses kana for よそ and kanji for 人.
Kanji spelling for よそ; less common but still encountered.
Alternate kanji spelling; rarely used in modern writing.
Compound of よそ (elsewhere, another place) + の (possessive particle) + 人 (person). The word よそ itself is of uncertain origin, possibly related to 余所 (other place).