It was narrated that the prophet (ﷺ) came out in Ramadan and lead the people in prayer. He came back again the following night and again lead people and after that he again came out, but then he did not come out, explaining that he did not want to make it obligatory upon the people.
Aisha, the mother of the faithful believers narrated that one night Allah’s Messenger offered the prayer in the Mosque and the people followed him. The next night he also offered the prayer and too many people gathered. On the third and the fourth nights more people gathered, but Allah’s Messenger did not come out to them. In the morning he said, “I saw what you were doing and nothing but the fear that it (i.e. the prayer) might be enjoined on you, stopped me from coming to you.” And that happened in the month of Ramadan. [Sahih Al-Bukhari Hadith 2.229]
Thus from this, it is understood that the Tarawih prayers are recommended and not obligatory, and that it is better to perform them in congregation at the Mosque, but if they are done at home, it is also acceptable, especially at times when it is not possible to pray in a congregation at the mosque.