Complex sentence: It was the Altan Khan who created the title of "Dalai Lama" ("Ocean of Wisdom") and bestowed it on the Gelugpa lineage, a title which was applied retrospectively to the first two Dalai Lamas.
Split into simpler sentences: It was the Altan Khan who created the title of "Dalai Lama" ("Ocean of Wisdom") and bestowed it on the Gelugpa lineage. The title was applied retrospectively to the first two Dalai Lamas.