A Vaishnava-based answer ahead, based on the teachings of SriMadhvacharya…
Lord Shiva has taken many avatars. He has five major roopas, by the names Sadyojaata, Tatpurusha, Vaamadeva, Ishaana, and Aghora. He even has a roopa known as Mrityunjaya. One of the yagya is known by this name only as the Mrityunjaya yagya, wherein these 5 forms of Lord Shiva + Mrityunjaya Lord Shiva are being worshipped. In these roopas, He is the nivaaraka of all kinds of mrityus, like Apamrityu, Ghoramrityu, etc.
Earlier, when Lord Brahma emerged from Lord Vishnu’s navel, Lord Brahma created sons from His mind, known as the Brahma-Maanasa Putras. Out of them, one was Sage Atri. He married Anasuya. Once, He was doing a fierce penance, and it was so fierce that the holy trinity had to appear in front of him. As a result, Lord Chandra, with the avesha of Brahma, was born as Soma from the eyes of Sage Atri.
Lord Vishnu appeared as Dattatreya and Lord Shiva appeared as Sage Durvasa. Sage Durvasa is an avatar of Lord Shiva. Lord Shiva, as Sage Durvasa, is known for His temper and curses. But He, as Sage Durvasa, is not cruel but is very compassionate. His penance is very high and is infinitely superior to ours.
In the Dakshayagya, when Daakshaayani Devi or Satidevi did dehatyaaga, at that time, the ganas informed Lord Shiva about the dehatyaaga of Satidevi. Lord Shiva was very angry about this. He took a hair from His jataa and tossed it on the ground. From that hair emerged Lord Veerabhadra. He went to the yagya and destroyed it. He broke Pusha’s teeth for laughing at Lord Shiva and removed the beard of Sage Bhrigu for cursing the Shiva ganas.
But in the end, Veerabhadra beheaded Daksha. So, this is the Veerabhadra roopa of Lord Shiva. During the Dvapara Yuga, Lord Vishnu had incarnated as Vedavyasa. Lord Vedavyasa was doing the Arani Mathana, and at that time, Lord Shiva appeared from there as Shukacharya.
Lord Shiva, as Shukacharya or Shukadeva, from birth itself was a vairagya shikhamani, which means He had a high level of detachment from the materialistic world and was a great devotee of Lord Vishnu. His vairagya was so great that when Lord Vedavyasa used to come, the women who were bathing naked in the river would put on their clothes out of fear, but when Shukacharya used to come, they wouldn’t, because they knew He was not at all attached to the material world, and would continue their play.
Shukacharya was such a detached person that, when He was only small, he left his home out of detachment to find Bhagavan. But then, out of great compassion, when the Supreme Lord Vedavyasa called him, telling that, He would be giving Shukacharya the Bhagavata, then Shukacharya ran to Lord Vedavyasa back, because of the Bhagavata.
After the Pandavas, Arjuna’s grandson and Abhimanyu’s son, Parikshita or Vishnuraata, became the king of Hastinapura. He ruled the kingdom with Dharma. Now, he had gone on a hunt in the forest. He felt very thirsty and came near the ashrama of Sage Shameeka. There, He tried to wake Shameeka Maharshi up, but he was in a state of Asampragyaata samaadhi, which means a state wherein a person is lost in the dhyaana of Bhagavan, so he doesn’t have the knowledge of what’s going on in his/her surroundings.
So, outwardly, King Parikshit thought that he was insulting him, and then King Parikshita put a dead snake in his neck. Sage Shameeka’s son, Sage Shringi, came to know this. He cursed Sage Parikshita to die by the bite of the serpent Takshaka after 7 days. King Parikshita came to know this, and then he left his kingdom, made his son Janamejaya the king, and came to the forest.
He came there, and at the banks of the river Ganga was doing the praayopavesha, which means fasting until death. And then, all the sages, including Lord Vedavyasa, gathered there. And then, came Shukacharya. And Shukacharya gave the upadesha of the Bhagavata Purana to King Parikshita for 7 days, and went away. And after that, Takshaka bit King Parikshita, and he attained Moksha.
Shukacharya also played a very important role in the marriage of Srinivasa at the Sheshachala Parvata. He was the one who took the message of Srinivasa to Akasharaaja, the father of Padmavati Devi. He even welcomed Srinivasa along with Padmavati Devi into his small ashrama. The other sages were angry since Shukacharya didn’t call them in. And they were about to curse Shukacharya when Srinivasa burped.
As He burped, the other sages too burped along, showing their stomachs were also full. Shukacharya wasn’t some old, aged sage, but was a young, handsome boy who didn’t wear any fancy clothes, just one kaupeena. He is always in the dhyaana of Lord Vishnu and doesn’t want anything in this world. He is always busy in the dhyaana of Lord Narayana.
Coming to another avatar of Lord Shiva, it is Ashvatthama, the son of Dronacharya and Krupi, the sister of Krupacharya. Ashvatthama was a great warrior and possessed great strength. So, there is some difference between the avatars of Lord Shiva and Lord Shiva Himself. In the Mahabharata, when Ashvatthama came to kill the Pandavas after the killing of Duryodhana, he confronted Lord Shiva, who was guarding the Pandavas.
Lord Shiva effortlessly engulfed all the arrows hurled by Ashvatthama. All these avatars are stated in the Puranas, especially in the Garuda Purana.
व्यासपुत्रः शुको नाम वायोराविष्ट एव च ।
रुद्रस्यावताराश्चैव लोके ज्ञानप्रसारकः ॥
The son of Lord Vedavyasa, by the name Shuka, and with the avesha of Vayudeva in him, is the incarnation of Rudra, or Lord Shiva, who spreads the true knowledge in the world.
[Garuda Purana]
अश्वत्थामा च यो जज्ञे द्रोणपुत्रो महाबलः ।
स साक्षाद्रुद्र एवेह जातो लोकसुखावहः ॥
That mighty Ashvatthama, who is the son of Dronacharya, is none other than Rudra.
[Shiva Purana]
So, these were the incarnations of Lord Shiva. As per the Vaishnava Sampradaya, and as per SriMadhvacharya, Hanuman is not considered the avatar of Lord Shiva because it is not even mentioned in the Valmiki Ramayana. Yes, Hanuman is known by the name of Rudramsha, but that Rudra doesn’t mean Lord Shiva; it means Lord Vayudeva, who is known by the name Rudra, because He removes sorrow.
Ravana was a big Shiva Bhakta. If Hanuman is Shiva’s avatar, then he wouldn’t have burnt Lanka because Lord Shiva would never harm His devotees. If someone worships Lord Shiva, then Lord Shiva would bless him and not harm him. He would never go against his devotees. Even when Banasura called Lord Shiva, He fought on Banasura’s side against Krishna. And as per the Valmiki Ramayana, Hanuman is the avatar of Vayudeva. Even the Balittha Sukta of the Rigveda, Vayupurana, and Garuda Purana say that Hanuman is the avatar of Vayudeva and not Lord Shiva. Even the Puranas state this.
अतो रोचननामासौ मरुदंशः प्रकीर्तितः ।
रामावतारे हनुमान्रामकार्यार्थसाधकः ॥
स एव भीमसेनस्तु जातो भूम्यां महाबलः ॥
Therefore, he is celebrated as a manifestation of the Wind God (Marud-ansha / Vayu). During the incarnation of Lord Rama, he appeared with the name Hanuman to completely fulfill the mission of Rama. He alone was later born on Earth with immense strength as Bhimasena (during the Dvapara Yuga).
[Garuda Purana]
वायुर्दिव्यानि रूपाणि पद्मत्रययुतानि च ।
त्रिकोटिमूर्ति संयुक्तस्त्रेतायाम् राक्षसान्तकः ॥
हनूमानिति विख्यातो रामकार्य धुरन्धरः ।
स वैमूर्भीमसेनोऽभूद्द्वापरान्ते कुरुद्वह ॥
The deity Vayu possesses divine, extraordinary forms. Destined to destroy the demons in the Treta Yuga, he manifested as the famous Hanuman, carrying the absolute responsibility of Lord Rama's mission. That same Vayu later manifested at the end of the Dvapara Yuga as Bhima, the pride of the Kuru dynasty.
[Vayu Purana]
The Taamasa Puranas may say that Hanuman is an avatar of Lord Shiva, but we must take only those verses from the Taamasa Purana that are in sync with the Saatvika Puranas and the Vedas. The ones that are opposite to the meanings of the Vedas shouldn’t be taken. So, Hanuman is an incarnation of Vayudeva, as per the Vaishnava Dharma and the Valmiki Ramayana.
Hope this helps!
Jay SriRam!
ShriShiva Antargata ShriBhaaratiramana Mukhyaprana Antargata ShriJayaa Sankarshana Abhinna ShriLakshmiNarasimha Abhinna ShriKrishnarpanamastu!