The Messenger of Allah ﷺ said, "Whoever builds a mosque in which Allah is remembered, Allah will build for him a house in Paradise."
أخبرنا عمرو بن عثمان قال حدثنا بقية عن بحير عن خالد بن معدان عن كثير بن مرة
أن رسول الله ﷺ قال من بنى مسجدا يذكر الله فيه بنى الله عز وجل له بيتا في الجنة
Ahmad narrated it, 4/386, from the hadith of Baqiyyah with the same wording, and he explicitly stated that he heard it directly. It is in Kubra, no. 767. Buhayr is Ibn Saad. The hadith has many corroborating reports in Bukhari, no. 450, and Muslim, no. 24/533, 25, and others.