How did the christians become the official religion of theroman empire?

Co-emperors Theodosius I, Gratian, and Valentinian II signed the Edict of Thessalonica in 380. This made mainstream Christianity (Latin or Western Christianity and Greek or Eastern Christianity) the sole legitimate religion of the Roman Empire. The purpose of the edict was to ban dissident Christian doctrines, which were branded as heretic. Their persecution started soon afterwards. The main target was Arian Christianity, which was popular around the empire.

At that time the Latin/Western church and the Greek/Eastern Church, which were the church of the western and eastern part of the empire respectively, were two branches of one church which was celled Catholic Church and they both subscribed to the Nicene Creed, a particular interpretation of the trinity. Later these two churches spit and came to be called Catholic and Orthodox respectively.