For forty years, the Roman Catholic church split, with there being two popes, an Avignon pope, or a pope that resided in Avignon (present-day France) instead of rome, and a Roman pope. This was resolved in the Council of Constance, where they elected Martin V, who unified the church again.
In the late middle ages (1300s), the Pope had political power along with spiritual power. Because of this, popes constantly disputed with Holy Roman Emperors over who the true leader of Christendom was. This tension built up until Pope Boniface VIII, who said that kings were subordinate to popes. In 1305, Clement V became pope. He was helped a lot by French clerics, and once elected, he decided against moving to Rome, and he established his court in Avignon, present-day France. For almost a century and seven popes, every pope was French and lived in Avignon. In December 1370, Gregory XI was elected, and he became the last Avignon pope.
Beginning of the Schism
In 1877, Gregory XI returned to Rome and ended the Avignon papacy. In 1878, Gregory XI died, and Romans rioted for a Roman pope. There weren't any good Roman candidates for papacy, so they elected a Neapolitan, or a person from Naples, named Pope Urban VI. He was a terrible pope; he was suspicious, he had a terrible temper, and many of the cardinals who elected him soon regretted it. The majority of cardinals moved to Anagni, a city near Rome, and they elected a rival pope named Clement VII, who went back to Avignon, while Pope Urban VI stayed in Rome.
Two Lines of Popes
After Urban VI died, he was succeeded by Pope Boniface IX, and continued the Roman papacy. Approximately five years after Urban VI died, Clement VII died and Benedict XIII was elected, who would be the last Avignon pope before the end of the Great Western Schism.
Council of Pisa
In 1409, the Catholic Church held a secret council trying to end the Western Schism. At the time, the Roman pope was Gregory XII, and the Avignon pope was Benedict XIII. When the meeting was held, it was found that neither pope was present at the meeting. This infuriated everyone, and both popes were declared guilty of contumacy, or missing a council. Many of the bishops there decided that popes were declared unworthy of being pope. So, they elected ANOTHER pope, who took the name of Pope Alexander V, who was part of the Pisa Papacy. Now, there were three lines of popes, and nothing was achieved at the meeting.
Council of Constance
From 1414 to 1418, a council was held for several reasons, but the primary reason was to end the Western Schism. Since the Council of Pisa, the Pisa pope, John XXII, gained a lot of support, at the expense of Benedict XIII. Pope Gregory XI and Antipope John XXII resigned, causing the end of the Western Schism. Benedict XIII refused to step down, so he was excommunicate by the other popes. Martin V was elected pope, and Benedict XIII was considered an official antipope. Benedict XIII elected an antipope, who elected another antipope, who eventually resigned, recognizing Martin V. Pope Gregory XI's resignation was the last resignation of a pope before Pope Benedict XVI in 2013. So, 39 years after it started, the Great Western Schism ended, and the Catholic church was united again.