Shaykh Ibn Uthaymeen was asked the following question:

Question:

وسئل فضيلة الشيخ: عن رجل نسي التشهد الأول فعلم أنه يجب عليه سجود سهو قبل السلام ولكنه نسي وسلم فما الحكم؟

A man forgot the first tashahud and he knew that he must do the sujud as-Sahw before the salam. However, he forgot and made tasleem. So what is the ruling?

Answer:

فأجاب فضيلته بقوله: إن ذكر في زمن قريب سجد، وإن طال الفصل سقط، مثل أن لا يذكر إلا بعد مدة طويلة، فلو خرج من المسجد فإنه لا يرجع إلى المسجد ويسقط عنه

If he remembered in a short time, he makes the sujud as-sahw. If the break was long, then it drops from him (the requirement of performing sujuh as-sahw). For example, he remembers after a long time after. So, if he left the masjid, then he does not return to the masjid. (Rather), it drops from him (the requirement of performing sujuh as-sahw).

[Majmoo al-Fatawa wa Rasaail (14/26)]

Translated by

Faisal Ibn Abdul Qaadir Ibn Hassan
Abu Sulaymaan