The pastime of Lord Siva's appearance is described inSrimad-Bhagavatam, 3.12.7โ13. Lord Brahma, the engineer of the universe, had asked four of his sons, celibate sages known as the Kumaras, to populate the worlds. When they refused, on the grounds that they wished to use their time purely for spiritual pursuits, Brahma became angry. Here's what happened then:
"Although Brahma tried to curb his anger, it came out from between his eyebrows, and a child of mixed blue and red was immediately generated. (7)
"After his [Siva's] birth, he began to cry: O destiny maker [Brahma], teacher of the universe, kindly designate my name and place. (8)
"The all-powerful Brahma, born from the lotus flower, pacified the boy with gentle words, accepting his request, and said: Do not cry. I shall certainly do as you desire. (9)
"Thereafter, Brahma said: O chief of the demigods, you shall be called by the name Rudra by all people because you have anxiously cried. (10)
"My dear boy, I have already selected the following places for your residence: the heart, the senses, the air of life, the sky, the air, the fire, the water, the earth, the sun, the moon, and austerity. (11)
"My dear Rudra, you have eleven other names: Manyu, Manu, Mahinasa, Mahan, Siva, Ritadhvaja, Ugrareta, Bhava, Kala, Vamadeva, and Dhritavrata. (12)
"O Rudra, you also have eleven wives, called the Rudranis, and they are as follows: Dhi, Dhriti, Rasala, Uma, Niyut, Sarpi, Ila, Ambika, Iravati, Svadha, and Diksha." (13)
Siva and Parvati, as his wife is also known, have their abode in Siva-loka, between the material and spiritual worlds (see Brahma-samhita 5.43). This description is of how Siva appeared in the material world.