Complex sentence: In 1778 he was pardoned and was allowed to return to Scotland, and his family became extinct when his son David died unmarried in April 1812.
Split into simpler sentences: In 1778 he was pardoned and was allowed to return to Scotland. His direct line became extinct when his son David died unmarried in April 1812.