Complex sentence: In a stroke of luck for the crew, they saw a black shepherd, but he ran away before they could speak to him; believing that they were indeed in Madagascar, they returned to the ship.
Split into simpler sentences: In a stroke of luck for the crew, they saw a black shepherd, but he ran away from them before they could speak to him. Believing that they were indeed in Madagascar, they then returned to the ship.