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?
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.
Adi Sankaracarya is an avatara of Shiva, as stated in Padma Purana (6.236.5-12), Kurma purana (1.30.33-34). Shiva Purana also quotes the Supreme Lord ordering Lord Shiva: "In Kali-yuga mislead the people in general by propounding imaginary meanings from the Vedas to bewilder them." How the Supreme Lord ordered Lord Shiva to appear in Kali-yuga to delude atheists and produce a philosophy and texts to hide the Supreme Being, and to make Shiva seem superior, is explained in the Padma Purana (6.71.89-116). Thus, we find in these verses confirmation that it was Lord Shiva who appeared in the Age of Kali as Shankaracharya at the request of the Supreme.
So, here we can see that he is incarnation of Shiva, but on other hands, in Bhagavata Purana, we can find that Shiva is the greatest devotee of Krishna, i.e. Vishnu.
In Bhagavata purana, 1.3, there is the list of Bhagavan's avataras, and 1.3.28 states... "ete camsa kalah pumsah, krsnas tu bhagavan svayam"... which means, "...mentioned avatars are plenary portions and portions of the plenary portions, but Krsna Himself (svayam) is Supreme God (bhagavan) for shure (tu)"...
Shiva is a vaishnama, so it is easy to conclude that Adi Sankara was Vaishnava as well with special mission - in the Padma Purana (6.236.5-12) Shiva explains to his wife, Parvati, that he will appear in the age of Kali to proclaim that the Buddhist doctrine is a false religion and illusory. He also said that he would propound the mayavada or impersonalist philosophy, emphasizing the indefinable nature of the Brahman, the great, impersonal spiritual force. He explained, "The philosophy of Maya (mayavada) is a wicked doctrine and is pseudo-Buddhist. In the form of a brahmana, I proclaim this doctrine in Kali-yuga. It makes the words of the holy Vedic texts meaningless and is condemned in the world. In this doctrine it recommends giving up one's duties of life [in order to be free of karma], which is said to be religiousness for those who have fallen from their duties. I will propound the identity of the Supreme Soul and the individual soul to be the [one and the same] Brahman in nature, without qualities. O goddess, I have conceived this mayavada (impersonalist) doctrine, which resembles a purport of the Ve das, for deluding people in this age of Kali [to mislead them toward atheism by denying the personal form of God]."
The Kurma Purana (1.30.33-34) states: "In Kali-yuga, Shankara, Nilalohita, will incarnate for the purpose of establishing rites of the Shrauta [Vedic] and Smarta [based on Smriti scriptures], with the desire for the welfare of his devotees. He will teach his disciples the knowledge of Brahman." The Shiva Purana also quotes the Supreme Lord ordering Lord Shiva: "In Kali-yuga mislead the people in general by propounding imaginary meanings from the Vedas to bewilder them." How the Supreme Lord ordered Lord Shiva to appear in Kali-yuga to delude atheists and produce a philosophy and texts to hide the Supreme Being, and to make Shiva seem superior, is explained in the Padma Purana (6.71.89-116). Thus, we find in these verses confirmation that it was Lord Shiva who appeared in the Age of Kali as Shankaracharya at the request of the Supreme.
Furthermore, he starts his commentary on Bhagavad gita with following statement:
narayanah paro 'vyaktat
which means that Narayana (Vishnu, Krsna) is ABOVE manifested world, he existed before manifestation, which is a bullet in the eye of every advaita follower. Advaita school teaches that Brahman, when manifested as avatara in material world, it assumes the material body, so Brahman incarnations had material body. But here we can see that Narayana WAS EXISTING before the manifestation and therefore He cannot have material body.
Adi Sankara also wrote a poem Bhaja Govindam, "A Hymn to Govinda - Krishna", and at the very first verse, he states ..."Worship Govinda, Worship Govinda, Worship Govinda. Oh fool! Rules of Grammar will not save you at the time of your death", calling his own disciples and lineage (parampara) mudha, fools and to worship (bhaja) Govinda, i.e. Krsna. He did not say worship (bhaja) Brahman...
To conclude, he was a vaishnava.
One of your questions is "Was Adi Shankara a devotee of Lord Shiva or of Lord Vishnu?".
Now,while this can not be ascertained definitively but we can surely get some hints.
The concluding verse of Ganga Stotram is :
गङ्गास्तोत्रमिदं भवसारं वाञ्छितफलदं विमलं सारम् । शङ्करसेवकशङ्कररचितं पठति सुखी स्तव इति च समाप्तः ॥१४॥
Ganggaa-Stotram-Idam Bhava-Saaram Vaan.chita-Phala-Dam Vimalam Saaram | Shankara-Sevaka-Shankara-Racitam Patthati Sukhii Stava Iti Ca Samaaptah ||14||
Meaning: 14.1: (Salutations to Devi Ganga) This Ganga Stotram is the true substance in this Samsara, giving desired Fruits, and is the essence of Purity, 14.2: This hymn is composed by Shankara (Adi Shankaracharya), the servant of Shankara (Shiva); those who read it will be filled with Joy; thus ends this Stava (Hymn) (with good wishes for all).
So, here Adi Shankara declares himself as to be a "Shankara Sevaka" or a servant of Bhagavan Shankara(Lord Shiva).So,this indicate that he might be a devotee of Lord Shiva.
Similarly,the concluding verse of the Annapoorna Stotram is:
माता च पार्वती देवी पिता देवो महेश्वरः । बान्धवाः शिवभक्ताश्च स्वदेशो भुवनत्रयम् ॥१२॥
Maataa Ca Paarvatii Devii Pitaa Devo Maheshvarah | Baandhavaah Shiva-Bhaktaash-Ca Svadesho Bhuvana-Trayam ||12||
Meaning: 12.1: (Salutations to Mother Annapoorna) My Mother is Devi Parvati, and my Father is Deva Maheswara (Shiva), 12.2: My Friends are the devotees of Shiva, and my Country is all the Three Worlds (Whose Lord is Shiva-Parvati).
This verse also can be taken as to indicate that Sri Adi Shankara was a devotee of Shiva-Shakti.
But in any case ,a devotee of whomsoever,Adi Shankara never discriminated between Shiva and Vishnu as explained in Tezz's answer.
And,for that reason,he promoted the Panchayatana Puja system in which all the 5 major Hindu Deities(Shiva,Vishnu,Devi,Ganapati and Surya) are worshiped together with equal respect.