Is It Better to Pray Sunnah at Home?
Question

Is it better to offer nafl (sunnah) prayers at home or in the mosque? Please quote the evidence.
Praise be to Allah.Is it better to pray Sunnah at home?
It is better to offer nafl prayers at home, unless it is Sunnah to pray them in congregation in the mosque, such as the prayers to be offered at the time of an eclipse , or it is narrated that it is encouraged to offer them in the mosque, such as nafl prayers before Jumu’ah . 
Evidence for offering Sunnah prayer at home
That was proven from the words and actions of the Prophet (peace and blessings of Allah be upon him). The evidence for that includes the following: 

Ibn ‘Umar narrated that the Prophet (peace and blessings of Allah be upon him) said: “Perform some of your prayers in your houses and do not make them graves.” (Narrated by al-Bukhari, 422; Muslim, 777) 

Al-Nawawi said: 
“The words “Perform some of your prayers in your houses and do not make them graves” mean, pray in them (your houses), and do not make them like graveyards which are devoid of prayer. What is referred to here is nafl (supererogatory) prayers , i.e., offer nafl prayers in your houses.” (Sharh Muslim, 6/67) 

Zayd ibn Thabit narrated that the Messenger of Allah (peace and blessings of Allah be upon him) made a cubicle – I think he said, made from a reed mat – in Ramadan, in which he prayed at night. Some of his Companions prayed behind him, and when he realized they were there he sat down. Then he went out to them and said, “I know how keen you are to pray behind me. O people, pray in your houses, for the best of prayer is a man’s prayer in his house, apart from the prescribed prayers.” (Narrated by al-Bukhari, 698; Muslim, 781) 

Al-Hafiz ibn Hajar said: 
“The apparent meaning is that this includes all nafl prayers , because what is meant by the prescribed prayers is the obligatory prayers. But it may be interpreted as referring to all those for which it is not prescribed to offer them in congregation and those which are not to be offered specifically in the mosque, such as the two rak`ahs for “greeting the mosque.” This is the view of some of our imams.” (Fath al-Bari, 2/215) 

‘Abd-Allah ibn Shaqiq said: I asked `Aishah about the voluntary prayers of the Messenger of Allah (peace and blessings of Allah be upon him). She said: He used to pray four rak`ahs before Zuhr in my house, then he would go out and lead the people in prayer, then he would come in and pray two rak`ahs. And he used to lead the people in Maghrib prayer, then he would come in and pray two rak`ahs. And he would lead the people in praying ‘Isha, then he would come into my house and pray two rak`ahs. And he would pray nine rak`ahs of night prayer (qiyam al-layl), including Witr. He would pray long prayers at night standing and long prayers at night sitting. If he recited Quran standing, he would bow and prostrate from a standing position and if he recited Quran whilst sitting he would bow and prostrate from a sitting position. Then when dawn came he would pray two rak`ahs.” (Narrated by Muslim. 730; there is a similar hadith narrated from Ibn ‘Umar in al-Sahihayn) 

Al-Nawawi said in his commentary: 
“This indicates that it is mustahabb to offer the regular nafl prayers in one's house, as is also the case with other nafl prayers. There is no difference of opinion among us on this point. This is the view of the majority and in our view and theirs, the nafl prayers connected to the obligatory prayers are the same whether they are done at night or during the day.” (Sharh Muslim, 6/9) 

Jabir said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “When any one of you finishes his prayer in his mosque, let him give his house a share of his prayer, for Allah will create something good in his house from his prayer.” (Narrated by Muslim, 778) 

Al-Manawi said: 
“The phrase “When any one of you finishes his prayer in his mosque” means, performing the obligatory prayer in a place where it is offered in congregation. The mosque is mentioned because that is where the prayer is usually held. “Let him give his house” means the place where he lives. “A share” means a portion. “Of his prayer” means, let him do the obligatory prayers in the mosque and the nafl prayers in his house, to bring barakah (blessing) upon his house and family, as he says, “for Allah will create something good in his house from his prayer”, i.e., because of the prayer. “Something good” means a great deal of good, because he has furnished his house with the remembrance and obedience of Allah, and the presence and glad tidings of the angels, and the reward and barakah that he brings to his family. 
It also indicates that nafl prayers offered at home are better than those offered in the mosque, even in al-Masjid al-Haram.” (Fayd al-Qadir, 1/418) 
There is more evidence than this, for the regular nafl prayers of the Prophet (peace and blessings of Allah be upon him), his night prayers (qiyam al-layl) and Duha prayer were all done in his house, but we have omitted (the reports concerning) that for the sake of brevity. What we have mentioned above is sufficient. Some of the scholars have stated that there is a reason for that: 
Ibn Qudamah said: 
“Offering voluntary prayers at home is preferable, because praying at home is closer to sincerity and furthest removed from showing off. It is an act that is done in secret, whereas doing it in the mosque is in public, and secrecy is better.” (Al-Mughni, 1/442) 
It also serves as a reminder to the forgetful and teaching of the ignorant among the members of the household or those who see him. 
Evidence for offering Eclipse prayer in the mosque
With regard to the evidence that it is mustahabb to offer the eclipse prayer in the mosque: 

Abu Bakrah said: We were with the Messenger of Allah (peace and blessings of Allah be upon him) when the sun was eclipsed. The Prophet (peace and blessings of Allah be upon him) got up, dragging his lower garment, and entered the mosque. We entered too, and he led us in praying two rak`ahs until the sun had cleared. Then he (peace and blessings of Allah be upon him) said: “The sun and the moon do not become eclipsed for the death of anyone. If you see that then pray and make du`a until the eclipse is over.” (Narrated by al-Bukhari, 993) 

Evidence for offering Sunnah prayer before Jumu`ah in the mosque
With regard to the evidence that it is mustahabb to offer the nafl prayers before Jumu’ah in the mosque: 

Salman al-Farsi said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “Whoever does ghusl on a Friday and purifies himself as much as he can, then puts oil (on his hair) and applies perfume, and does not force his way between two persons (assembled in the mosque for the Friday prayer), then prays as much has been decreed for him, then keeps quiet when the imam comes out (to deliver the khutbah), his sins between that Friday and the previous one will be forgiven.” (Narrated by al-Bukhari, 868) 

And Allah knows best.