As far as Joseph being her husband…
Mary’s Relationship to Joseph
In the Bible, Mary is first engaged and later married to Joseph the carpenter from Nazareth. The Qur’an and other Muslim sources mention him hardly at all, and if so he is still never referred to as the husband but only as a guardian of Mary.
Mary attained puberty, and she began to stay with Zechariah’s wife during the courses of her menstruation, and after completing the menstrual cycle and performing the ghusl (the major ritual ablution, which entails the washing of the whole body), she would return, ritually pure, to her mihrab. Mary increased in worship until there was no person known at that time who approached her in the time of worshipping. Being physically capable at this stage in her development, Mary began her service at the Temple. It is at this point that Joseph (Yusuf) the Carpenter begins to appear in the accounts of her life. However since Joseph is never mentioned in the Qur’an or hadith material, the information supplied concerning him, and especially about his connection with Mary, is expressed with extreme caution. Such accounts are either concluded with a prudent ‘wa’Ilahu a ‘lam (‘and God knows best’) or prefaced with the words ‘it is said’, ‘they say’ (the identity of the source being left unspecified) or, at times, ‘Christian sources say’. The following discussion can hence be no more than an attempt to clarify the elements which recur with the most frequency and appear to have been most widely acquiesced in by Islamic scholarship.
Joseph is said to have been Mary’s cousin, a carpenter who was also in service at the Temple. As a result, he became aware of Mary’s devoutness and the palpable excellence of her worship. They both made use of a source of water in a grotto on the Mount of Olives (Jabal al-Zaytun). Then there is a solitary account found in Ibn Hisham’s Sira (biography of the Prophet), and attributed to Ibn Ishaq. This account implies a second casting of lots:
It was Jurayj the priest, a man of the Israelites, a carpenter, whose arrow separated out, who took responsibility for Mary. And it was Zachariah who had been her guardian before this time. The Israelites had suffered a terrible calamity, and Zachariah had grown too old to bear the responsibility of Mary; thus they cast lots for her, and Jurayj the priest won, and took the responsibility.
The same account is found in Tha‘labi’s collection of prophetic biographers (Qisas), still uniquely attributed to Ibn Ishaq, except this time it is Joseph the Carpenter who cast lots and gains responsibility for the guardianship of Mary. Due to the solitary attestation of this anecdote, the lack of reference to it in the Qur’an and hadith, and the confusion of identities in the two versions, it must be discarded as unreliable. In fact, in traditional Muslim sources Joseph’s relationship with Mary is frequently not clarified, or he is mentioned as her companion and relation only, because there is no revealed basis for anything more specific, such as the statement that he was her fiancé and later became her husband, both of which are generally attributed to the Gospels, if mentioned at all. Ibn al-Qayyim further claims that Mary and Joseph were from different tribes and thus could not have been married to each other as this was against Jewish law. (Mary The Blessed Virgin of Islam, pp. 28-29)
You can find this reference an many others here…
answering-islam.org/Index/M/mary.html