Complex sentence: When Muhammad arrived in Medina he was offered accommodations by all of its inhabitants, but he wished to stay with the Banu Najjar, whom he was distantly related to.
Split into simpler sentences: When Muhammad arrived in Medina, he was offered accommodation by all of its inhabitants. He wished to stay with the Banu Najjar, whom he was distantly related to.