I know Dhakshinamurthi is a form of Shiva. Jupiter is one of the nine planets(navagraha). But I often find in texts and in the internet these two names are used interchangeably like there is no difference between them. From my understanding Jupiter is Brahaspathi a sage who is a rival of Shukracharya. Is there any relationship between Shiva and the guru (Jupiter ) ?
You might have confused between the words Guru, Brihaspati (Jupiter) and Dakshina Murthy.
There are many dictionary meanings (clicking on link takes to Monier-Williams Sanskrit-English dictionary) for the word Guru.
The etymological meaning of Guru is as follows (also a popular one):
guśabdastvandhakāraḥ syāt ruśabdastannirodhakaḥ।
andhakāranirodhitvāt gururityabhidhīyate॥ 16॥
The syllable gu means darkness, the syllable ru, he who dispels them, Because of the power to dispel darkness, the guru is thus named. Advayataraka Upanishad, Verse 16
Relation between Guru and Brihaspati:
Brihaspati is the guru (preceptor, mentor) of devas. He guides the devas during the time of crisis by his wisdom. Apart from this he wrote smritis for the welfare of the mankind He is also called Guru because of this quality. Brihaspati's name is used interchangeably with Guru in texts like Puranas as well (at least 100 references can be found). Thursday is called Brihaspati vasara in Sanskrit and Guru vaara in some languages.
Dakshina Murthy as Guru:
In Dakshina Murthy stotram, he is called as Guru denoting removing darkness of ignorance.
nidhaye sarvavidyānāṃ bhiṣaje bhavarogiṇām ।
gurave sarvalokānāṃ dakṣiṇāmūrtaye namaḥ || 
(Salutations to Sri Dakshinamurthy) Who is a receptacle to all Knowledge, Who is a Medicine to all the diseases of Worldly bondage, Who is a Guru to all the Worlds; Salutations to Sri Dakshinamurthy. Dakshina Murthy Stotram
In the sense of removing ignorance through knowledge, Dakshina murthy is called Guru of all the lokas and not as synonymous to Brihaspati, Guru (teacher) of Gods.
Shiva in the form of Dakshina Murthy is called Guru. Besides this, he is the origin of many traditions. He is also called Guru for that reason. Brihaspati being mentor, teacher to devas is called Guru. Guru also means heavy (Guru = heavy and laghu means light). But Brihaspati or Jupiter is not used interchangeably for Shiva.