Al-Bukhari narrated in his Saheeh that Jabir ibn ‘Abd-Allah (may Allah be pleased with him) said: When we went up we would say takbeer (Allahu Akbar) and when we went down we would say tasbeeh (Subhan Allah).
Abu Dawood narrated that Ibn ‘Umar taught him that when the Messenger of Allah (blessings and peace of Allah be upon him) got up on his camel, when he was setting out on a journey, he would say takbeer three times, then he would say: “Subhaan allathi sakhkhara lana hadha wa ma kunna lahu muqrineen wa inna ila rabbina la munqaliboon. Allaahumma inna nas’aluka fi safarina haadha al-birra wa’l-taqwa wa min al-‘aml ma tarda, Allaahumma hawwin ‘alayna safarana haadha watwi ‘anna bu’dahu. Allaahumma anta al-saahib fi’l-safar wa’l-khaleefah fi’l-ahl (Glory be to the One Who has placed this (transport) at our service and we ourselves would not have been capable of that, and to our Lord is our final destiny. O Allah, we ask You for righteousness and piety in this journey of ours, and we ask You for deeds which please You. O Allah, facilitate our journey and let us cover its distance quickly. O Allah, You are the Companion on the journey and the Successor (the One Who guards them in a person’s absence) over the family).”
And when he returned he would say the same words and would add to them: “Ayiboona taiboona ‘abidoona li rabbina hamidoon (Returning, repenting, worshipping and praising our Lord).”
When the Prophet (blessings and peace of Allah be upon him) and his army climbed a hill they would say takbeer and when they went downhill they would say tasbeeh.
Those scholars who say that this is mustahabb (recommended) when going up the stairs and so on, say that one should say takbeer when going up and that going up stairs or hills is the same thing.
But others say that saying takbeer when going up the stairs and so on is not prescribed, because that was not narrated except in specific circumstances, namely climbing up a mountain and the like when travelling; with regard to going up the stairs and so on, there is no such report, even though this was something known among them and they used to do it (i.e., climb up and down stairs etc). If it were prescribed, the Prophet (blessings and peace of Allah be upon him) would have done it or he would have taught it to his companions as he taught them what to say when entering the house and when leaving it, and other adhkar (words of remembrance) to be recited every day and night.
This is the most correct view concerning this issue.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked the following question: It says in the hadeeth that the Prophet (blessings and peace of Allah be upon him) used to say takbeer when climbing a hill and tasbeeh when going down into a valley. Is this takbeer and tasbeeh only when travelling, or did he say takbeer – for example – at home when going up to the second and third floor? May Allah reward you with good.
During his journeys, when the Prophet (blessings and peace of Allah be upon him) climbed up a hill he would say takbeer, and when he went down into a valley he would say tasbeeh. That is because the one who is above a thing may feel proud and think that he is great, so it is appropriate for him to proclaim the greatness of Allah, may He be glorified and exalted, by saying: Allahu akbar. And when he descends, he is going down to a lower level, so it is appropriate for him to glorify Allah, may He be glorified and exalted, when going down. This is the context of saying takbeer and tasbeeh.
But there is no report in the Sunnah (prophetic teachings) about doing that when not travelling. Acts of worship are based on tawqeef i.e., they are limited to what is narrated in sound reports. Based on that, when a person goes up the stairs in his house he does not have to say takbeer, and when he comes downstairs he does not have to say tasbeeh. Rather that only applies in the case of travelling.
End quote from Liqaa’aat al-Baab al-Maftooh.
And Allah knows best.