Q: Adi Shankaracharya taught Advaita philosophy. What was his belief on how one should see Shiva and Vishnu? Was he a Shaiva or a Vaishnava? Are Shiva and Vishnu same as per Him?

A: Shankaras Advaita is called Kevala Advaita ie. Only Advaita; there is no duality at all and any duality that is perceived is just due to ignorance. Here are some features of Shankara’s philosophy:

1) Omniscience, omnipotence etc.. attribute in Lord is seen due to Avidya.

This point is made by Adi Shankara in Brahma Sutra Bhasyam 2.1.14. This point clearly separates Advaita from other philosophies like Vishistadvaita. In Brahma Sutra Bhasyam 2.1.14 Shankara says:

तदेवमविद्यात्मकोपाधिपरिच्छेदापेक्षमेवेश्वरस्येश्वरत्वं सर्वज्ञत्वं सर्वशक्तित्वं च, न परमार्थो विद्यया
अपास्तसर्वपाधिस्वरुपे आत्मनि ईशत्रीशितव्यसर्वज्ञत्वादिव्यवहार उपपद्यते, तथा चोक्तम् - 'यत्र नान्यपश्यति
नान्यच्छृणोति नान्यद्विजानाति स भूमा इति' यत्र 'त्वस्य सर्वमात्मैवाभूत्तत्केन कं पश्येत्' इत्यादिना च एव
परमार्थवस्थायां सर्वव्यवहाराभावं वदन्ति वेदान्ता ।। 2.1.14

Hence the Lord’s being a Lord, his omniscience, his omnipotence, &c. all depend on the limitation due to the adjuncts whose Self is Avidya; while in reality none of these qualities belong to the Self whose true nature is cleared, by right knowledge, from all adjuncts whatever. Thus Scripture also says, ‘Where one sees nothing else, hears nothing else, understands nothing else, that is the Infinite’ (Ch. Up. VII, 24, 1); ‘But when the Self only has become all this, how should he see another?’ (Bri. Up. II, 4, 13.) In this manner the Vedânta-texts declare that for him who has reached the state of truth and reality the whole apparent world does not exist.

Thus the above Bhasya makes it clear that the attributes of God like Shiva and Vishnu (like omniscience, omnipotence etc..) are seen due to Ignorance. These things do not exist at all. So, the Shiva-Vishnu debate doesn’t exist in Shankaras philosophy at all. This also makes it clear that when Shankara defines highest thing using name of God, it clearly represents Nirguna Brahman.

In the same Bhasya Shankara also says:

Such texts are, ‘In that all this has its Self; it is the True, it is the Self, thou art that’ (Ch. Up. VI, 8, 7); ‘This everything, all is that Self’ (Bri. Up. II, 4, 6); ‘Brahman alone is all this’ (Mu. Up. II, 2, 11); ‘The Self is all this’ (Ch. Up. VII, 25, 2); ‘There is in it no diversity’ (Bri. Up. IV, 4, 25).–On any other assumption it would not be possible to maintain that by the knowledge of one thing everything becomes known (as the text quoted above declares). We therefore must adopt the following view. In the same way as those parts of ethereal space which are limited by jars and waterpots are not really different from the universal ethereal space, and as the water of a mirage is not really different from the surface of the salty steppe–for the nature of that water is that it is seen in one moment and has vanished in the next, and moreover, it is not to be perceived by its own nature (i.e. apart from the surface of the desert -; so this manifold world with its objects of enjoyment, enjoyers and so on has no existence apart from Brahman.

2) Shankara rejects philosophy of both Shaiva Aagams and PanchaRatra Aagams:

Those Vaishnavas, who adhere to Vedanta darshan, commented on Brahma Sutras by intrepreting Sutras in favour of PanchaRatra (Vaishnava) Aagams. Similarly , those Shaivas, who adhere to Vedanta darshan, commented on Brahma Sutras by intrepreting Sutras in favour of Shaiva Aagams.

However Shankara rejects both PanchaRatra Aagams and Shaiva Aagams. Eg. Shankara rejects philosophy of Shaiva Aagams here as:

The Máhesvaras (Saivas) maintain that the five categories, viz. effect, cause, union, ritual, the end of pain, were taught by the Lord Pasupati (Siva) to the end of breaking the bonds of the animal (i.e. the soul); Pasupati is, according to them, the Lord, the operative cause.–Similarly, the Vaiseshikas and others also teach, according to their various systems, that the Lord is somehow the operative cause of the world. Against all these opinions the Sutra remarks ’the Lord, on account of the inappropriateness.’ I.e. it is not possible that the Lord as the ruler of the pradhâna and the soul should be the cause of the world, on account of the inappropriateness of that doctrine.

Similarly Shankara criticises PanchaRatra (Bhagvata) doctrine [ here ] as:

Moreover, manifold contradictions are met with in the Bhâgavata system, with reference to the assumption of qualities and their bearers. Eminence of knowledge and ruling capacity, strength, valour, and glory are enumerated as qualities, and then they are in some other place spoken of as Selfs, holy Vâsudevas, and so on.–Moreover, we meet with passages contradictory of the Veda. The following passage, for instance, blames the Veda, ‘Not having found the highest bliss in the Vedas Sândilya studied this sâstra.’– For this reason also the Bhâgavata doctrine cannot be accepted.

Thus, for this reason also, Shankara can be neither called Shaiva nor Vaishnava.

3) Shankara calls Narayana as the witness of all:

In the BrihadAranyaka Upanishad Bhasya 3.7.1 Shankara states:

देवताकार्यकरणस्य ईश्वरसाक्षिमात्रसान्निध्येन हि नियमेन प्रवृत्तिनिवृत्ती स्याताम् ; यईदृगीश्वरो नारायणाख्यः,
पृथिवीं पृथिवीदेवताम्...

The body and organs of the deity of the earth are regularly made to work or stop work by the mere presence of the Lord as witness. Such an Iśvara, called Nārāyaṇa, who controls the deity of the earth….

4) Shankara calls Shiva as Sarvajna Ishwara:

While identifying the Uma Haimavati Devi in Kena Upanishad Bhasya, Shankara states:

अथवा उमैव हिमवतो दुहिता हैमवती नित्यमेव सर्वज्ञेनेश्वरेण सह वर्तत इति ज्ञातुं समर्थेती कृत्वा ताम् ।।

Or Uma is Haimavati as she is the daughter of Himavat. As she always lives with that Sarvajna Ishwara (Shiva), she knows the Brahman.

5) Shankara cites Lord Avimukta as highest:

In the Brahma Sutra Bhasya 1.2.32, Shankara cites a Shruti passage from Jabala Upanishad which states Highest Lord is Lord Avimukta (Shiva) and he resides in Varanasi (which I also discuss here)

आत्मनन्ति चैनं परमेश्वरमस्मिन्मूर्धचुबुकान्तराले जाबाला - "  य एषोऽनन्तोऽव्यक्त आत्मा तं कथमहं विजानीयामिति ॥ स
होवाच याज्ञवल्क्यः सोऽविमुक्त उपास्यो य एषोऽनन्तोऽव्यक्त आत्मा सोऽविमुक्ते प्रतिष्ठित इति ॥  का वै वरणा का च नाशीति
Moreover the Gâbâlas speak in their text of the highest Lord as being in the interstice between the top of the head and the chin. ‘The unevolved infinite Self abides in the avimukta (i.e. the non-released soul). Where does that Avimukta abide? It abides in the Varanâ and the Nâsî, in the middle. What is that Varanâ, what is that Nâsî?

And at the last of that Bhasya he says:

तस्मात परमेश्वरो वैश्वानर इति सिद्धम् ।

Thus it is proved that Vaishvanara is the Parameshwara.

6) Shankara in Vivekchudamani:

In the 494th verse of Vivekchudamani Shankara states:

नारायणोऽहं नरकान्तकोऽहं
पुरान्तकोऽहं पुरुषोऽहमीशः ।
निरीश्वरोऽहं निरहं च निर्ममः ॥

494 - I am Narayana, the slayer of Naraka; I am the destroyer of Tripura, the Supreme Being, the Ruler; I am knowledge Absolute, the Witness of everything; I have no other Ruler but myself, I am devoid of the ideas of “I’ and “mine”.

This also shows Shiva-Vishnu Abheda philosophy of Shankara.

7) Shankara while commenting the name ‘Rudra’ in Vishnu Sahasranaamam:

There is also a name ‘Rudra’ in Vishnu Sahasranamam and Shankara comments it as:

रुर्दुःखं दुःखकारणं वा, द्रावयतीति रुद्रः रोदनाद् द्रावद्वापि रुद्र इत्युच्यते ।

‘Ru’ means suffering or cause of suffering, and thus Rudra is the remover of suffering. Who ends the crying of samsara he is Rudra.

And then he cites a verse from Shiva Purana stating it:

'रुर्दुःखं दुःखहेतु वा तद्रावयति यः प्रभुः ।
रुद्र इत्युच्यते तस्माच्छिव परमकारणम् ।।'

“Ru means suffering and cause of suffering and Lord is the remover of that. Thus he is called Rudra and thus Shiva is the Parama Kaaranam (Supreme cause).”

Interestingly while commenting on names of Vishnu in Vishnu Sahasranaama he cites a verse from Shiva Purana which holds Shiva as Parama Kaarana. Thus it clearly shows that Adi Shankara held no difference between Hari and Hara. Shankara also cites a verse by Maheswara in Harivamsha in his Bhasya which states that name of Vishnu also belongs to Shiva.

नामानि तव गोविन्द यानि लोकेमहान्ति च ।
तान्येव मम नामानि नात्र कार्या विचारणा ।। (Harivamsha 3.88)

Oh Govinda your names which are famous in this world, these are also my names there is no doubt in it.

So, actually Vishnu Sahasranaama Bhasya written by Adi Shankara is also Shiva Sahasranama Bhasya.

8) Shankara cites statement of Sri Krishna:

Shankara in Vishnu Sahasranama Bhasya cites statement of Lord Krishna from Vishnu Purana which was told by Lord Krishna to Lord Shiva during Banasur event:

त्वया यदभयं दत्तं तद्दत्तमग्विलं मया ।
मत्तो विभिन्नमात्मानं द्रष्ट्रं नार्हसि शंकर ।।
योऽहं स त्वं जगच्चेदं स देवासुरमानुषम् ।
अविद्यामोहितात्मानः पुरुषा भिन्नदर्शिन ।।(Vishnu Purana 5.33.47-49)

That Abhaya which was given by you was also given by me. Oh Shankara do not see yourself different from me. That which is me the same is you, this entire creation, Devas, Manyushyas and Asuras. Only those who are deluded by Avidya see me and you as different.

Thus Shankara expounds those who see difference (especially between Hari and Hara) are “Avidya Mohita Atman” (those deluded by Avidya).

9) Shankara’s warning to those who see difference:

Shankara in his Vishnu Sahasranama Bhasya explicitly states seeing Trimurtys (especially Hari and Hara) as different is a great sin. Shankara cites statement of Maheswara from Bhavisyottar of Harivamsha as:

विष्णोरन्यं तु पश्यन्ति ये मां ब्रह्माणमेव वा ।
कुतर्कमतयोमूढा पश्यन्ते नरकेष्वध ।।
ये च मूढा दुरात्मानो भिन्नं पश्यन्ति मां हरे ।
ब्रह्माणं च ततस्तस्माद् ब्रह्महत्यासमं त्वधम् ।।

He who sees myself and Brahma different than Vishnu, such fools surely fall in hell. That Durãtmãn who sees myself different from Hari does a sin equivalent to BrahmaHatya.

Similarly Shankara also states statement of Maheswara as:

आवयोरन्तर नास्ति शब्दैरर्थैर्जगत्त्रये ।। (Harivamsha 3.88)

There is no difference between you and me neither by Shabda (word) nor by meaning (artha).

Thus it’s clear that Shankara taught Trimurty Abheda philosophy. From the above statements we can know that Shankara holds those who see difference between Hari and Hara are Avidya Mohita Atman (Deluded by ignorance),Kutarkavadi (Who generates nonsense logic),Mudha (Who is fool), Narakeshvada (Who goes to Naraka), BrahmaHatya Sama (Who does sin equal as BrahmaHatya)

All these are not self made claims of Adi Shankara. Shankara cites these verses or passages from Harivamsha Parva and Vishnu Purana.