Complex sentence: Temple while at Cambridge became a close friends also to Thomas Gray, and during a visit to London in February 1766 Boswell introduced him to Samuel Johnson.
Split into simpler sentences: Temple while at Cambridge became a close friends also to Thomas Gray. During a visit to London in February 1766 Boswell introduced Temple to Samuel Johnson.