Lord Shiva is depicted as sitting in Smashanam.
Which Hindu Scriptures say this? Why does he sit in Smashan?
It is stated in Anushasana Parva of Mahabharata. Lord Shiva himself answers this question on being asked by Uma.
"Uma said, 'Thou hast many abodes in heaven, of diverse forms and possessed of every comfort and luxury. Why, O holy one, dost thou reside in the crematorium, abandoning all those delightful mansions? The crematorium is full of the hair and bones (of the dead), abounds with vulture and jackals, and is strewn with hundreds of funeral pyres. Full of carrion and muddy with fat and blood, with entrails and bones strewn all over it, and always echoing with the howls of jackals, it is certainly an unclean place.'
"Maheswara said, 'I always wander over the whole earth in search of a sacred spot. I do not, however, see any spot that is more sacred than the crematorium. Hence, of all abodes, the crematorium pleases my heart most, shaded that it generally is by branches of the banian and adorned with torn garlands of flowers. O thou of sweet smiles, the multitudes of ghostly beings that are my companions love to reside in such spots. I do not like, O goddess, to reside anywhere without those ghostly creatures being by my side. Hence, the crematorium is a sacred abode to me. Indeed, O auspicious lady, it seems to me to be the very heaven. Highly sacred and possessed of great merit, the crematorium is much applauded by persons desirous of having holy abodes.' [Anushasana Parva section CXLI]
There is also mentioning in Shreemad Bhagvat Purana" about Lord Shiva lives or resides in Cremation ground or "Smashana" in the (4th skanda Adhaya 4 Shloka 16) . This chapter is about Devi Saties entering into fire.& devi Sati's conversation with her father Daksha about lord Shiva.Here Sati devi is actually glorifying lord shiva, by explaning the actual nature of lord Shiva , unlike what (Daksha) thinks of.
This shloka tells us about Lord Shiva sitting or residing or wondering in cremation grounds.
किं वा शिवाख्यमशिवं न विदुरस्त्वदन्ये ब्रह्मादयस्तमवकिर्य जटा: श्मशाने ।
तंमाल्यभस्मनृकपाल्यवसपिशाच र्ये मुर्धभिर्दधति तच्चरणासृष्टम् ।।16।।
Kim Va ShivakhyamShivam Vidurstvdanye BrahmadyasamstamVkirya Jatahha Shamashane l tmmalyabhasmaNrukapalyaVasaPishachhya yer Mudharbhidrdhati Tachhrana Shrustam.
Meaning - Its only you who thinks that he is "Ashiva" (No pure) and nobody else , if it is true then why otherwise lord shiva ,who resides in Cremation ground (Smashana) with Bhoot-Pishachhya , Is praised by lord Brahma & other devatas(Gods) and why would Brahma and othet God's would have kept the flowers fallen from his feet ( Nirmalya) on their heads.
Why does he sit in Smashan?
न यस्य लोके SS स्त्यतिशायनः प्रिय-स्तथाप्रियो देहभृतां प्रियात्मना: ।
तस्मिन् समस्तात्मनि मुक्तवैरके ऋते भवन्तः कतमः प्रतीपयेत ।।11।।
NaYasya Lokestatishayanah PriyaStathapriyo Priyatmanah Tasmin Samsstatmani MuktaVairake Rute Bhavantah PratiPayet
Meaning - I this world there is nobody Great as Lord Shankara.He is the dear soul of all the beings with body. "Nobody is dear to him or nor he dislikes anybody" so he dont have any prejudice with any being. Its you only who is opposing him.
I am trying to give the answer or explanation of this question from above shloka also from "Shreemad Bhagvatam" . Here sati says Lord Shiva is soul inside everybeings who are with body (Ganas गण) .That mean he is inside everytype of creature as soul.Thus he never differentiates between anybody.Nobody is dear to him or nor he dislikes anybody" so he dont have any prejudice with any being or any type of creatures (Bhoot etc.). So i think this is also one of the reason why he resides in cremation grounds.As he (Lord Shiva)himself is the Purestst ,that he do not differentiates between cremation ground (Smashan) and any other place or company of any type of creatures. So as Lord Shiva sits and wonders with his family similarly he lives and wonders with his "Ganas".
Which Hindu Scriptures say that Lord Shiva lives in Samshana?
I'm answering only this part.
I think it must be so mentioned in many scriptures but for the time being i'm only able to quote from the Skanda Purana, a Stuti of Lord Shiva done by Devaguru Brihaspati .
At one place,this Stotram praises Lord Shiva as "Smashana Vasiney" meaining "One who lives in Smashana or the cremation grounds".
Devotees are supposed to recite this Stotram at the onset of their Pradosha kala Puja to Lord Shiva;
Deva Guru Brihaspathi taught the Procedure of Worship to Bhagavan Siva on Kartika month’s Sukla Paksha Pournami or the full moon day.......
Later on, the devotee should execute hundred and eight ‘Pradakshinas’ or circumambulations and Namaskars followed by ‘Stuti’ or commendation as follows:
Siva Stuti: ‘Namo Rudraya, Neelaaya, Bhimaya Paramaatmaney, Kapardiney Sureshaya, Vyomakeshaya vai Namah/ Vrushabhadwajaaya Somaaya Somanathaaya Shambhavey, Digambaraaya Bhargaaya Umaakaanthaya vai Namah, Tapomayaya Bhavyaya Sivasreshthaaya Vishnavey, Vyalapriyaya Vyaalaaya Vyalaanaampathaye Namah / Mahidharaya Vyaghraya Pashunam pathaye Namah, Puraanthakaaya Simhaaya Shaardulaaya Makhaaya cha / Meenaya Meena nathaaya Siddhaya Parameshtiney, Kaamaanthakaya Buddhaaya Buddheenaam pathaye namah / Kapothaya Vishishtaaya Sishtaaya Sakalaatmaney, Vedaaya Veda Jeevaaya Veda Guhyaya vai Namah / Deerghaya Deergha Rupaya Deerghaarthaya vinaashiney, Namo Jagatprathishthaaya Vyomarupaaya vai Namah/ Gajaasura Mahaakaalay andhakaasura bhediney, Neelalohitha Suklaaya Chanda Munda Priyaya cha / Bhakti Priyaya Devaaya Jnaaney Jnaanavyaya cha, Maheshaya Namasthubhyam Mahadeva Haraaya cha / Trinetraya Tri Vedaya Vedaangaaya Namo Namah, Arthaya cha Artha rupaaya Paramaarthaya vai Namah / Viswa Bhushaya Viswaya Vishwanaadhaya vai Namah, Shankaraayacha Kaalaaya Kaalaavayarupiney / Aruupaaya Viruupaaya Sukshma Sukashmaya vai Namah, Smashaana vaasiney Bhuyo Namasthey krutthi vaasasey/ Shashaanka Shekharayeshaa yograbhumishayaya cha, Durgaya Durgapaaraya Durgaavayava sakshiney/ Linga Rupaaya Lingaaya Lingaanaam pathayenamah, Namah Pralaya Rupaaya Pranavarthaya vai Namah/ Namo Namaha kaarana kaaranaaya Mrityunjayaaya atmabahva swarupiney, Sri Thriyambikaayaasitikantha Sarva Gauripathey Sakala Mangala hetavey namah/
'Shma' refers to corpse(shava), 'shan' refers to bed(shanya).So Shiva resides where the dead bodies are kept i.e cremation ground. Often Shiva is referred as the destroyer because he is one who destroys the body conciseness . Hence as a symbolic representation Shiva stays in the cremation ground.Shiva is also seen smeared in ash .This reminders us of our true nature, which is the atma, our soul. Our soul never undergoes any change just like the ash don't any change further.
There is indeed reference to Shiva as resident of burial ground in various tantric books and Puranas.
Mahabharata, Shanti Parva (12.328.5 onwards, dialogue between Lord Krsna and Arjuna):
Kapardi jatilo mundah zmazana grhas evakah ugravrata dharo rudro yogi tripura darunah daksa kratu haraz caiva bhaga netra haras tatha
[Rudra has] braided hair with knot of an ascetic and rest of the head bald. He dwells in the home of graveyard, steadfast on vigorous penance as a yogi. He is ferocious to Tripurasuras, destroyed Daksayajna and took away the eyes of Bhaga.
The following are slokas from Shiva Sahasranama(from Mahabaratha,Santi parva)
प्रवृत्तिश्च निवृत्तिश्च नियतः शाश्वतो ध्रुवः ।
श्मशानचारी भगवान् खचरो गोचरोऽर्दनः ॥ ३॥
महानासो महाकम्बुर्महाग्रीवः श्मशानधृक् ।
महावक्षा महोरस्को अन्तरात्मा मृगालयः ॥ ५७॥
The two words (in bold) should explain things much better.
In the text Bṛhannīlatantra which has a printed version in Sanskrit – see for example we found clear this one:
“The place of śiva is the cremation ground and duelling is the void”
śivasthāne śmaśāne ca śūnyāgāre … (18-178)
Also, in 6-92, we have a reference on how a kula (or kaula) adept must consider the corpse and remember the śaktī (in fact, kālī 6-90):
“When someone see the cremation ground and corpse, (he - the one which is kindly disposed towards Kula path) must think with respect and salute the dearest or beloved (companion) of śankara ( śiva).”
“kulācāraprasannāsye namaste śaṃkarapriye / śmaśāne ca śavaṃ dṛṣṭvā pradakṣiṇamanuvrajan”
[Also we can interpret and translate as “while one makes circumambulation from left to right of corpse and cremation ground.”].
I think I shall expand this answer with more textual references soon. I have translated myself the above phrases, so be kind and suggest correction, if is the case.
Many quotations have been given from different scriptures that shows that Lord Shiva lives in smashana. I quote from Shivastotra (Uttarakanda, Ramayana) by Brahmaa
Smashanavasi bhagavan umaapatir arindamah.
Why does Shiva reside in Smashana?
According to Sri Sitaramdas Omkarnath, one meaning of Smashana is Sushumna.Lord Shiva with His Shakti resides in Sushumna. So He is known as Smashanavasi.
This is supported by the scriptures.According to the Pranatoshini Tantra, (Kanda 6, section 1, page 413)
mahapathah smashanam cha sushumna api ekam eva hi
meaning smashaana and sushumna are synonymous.
According to Kali-Tantra
smashanam rudrasthaanam tattu nityam kailasasya dakshinashringe
So here smashana is near Kailasha which is abode of Lord Shiva.
(Reference: Omkarnath Rachanavali:Matri-gatha and Shivanamamrita-Lahari,Mahamilan Math, vol.11, page 171).
Sastramulak Bharatiya Shaktisadhana, Upendrakumar Das, RMIC, vol 1, page 539