Complex sentence: One story says that Akhfash was a diligent student, and after learning his lessons from his teachers, he practiced them in front of his goat until his goat nodded its head in affirmative, which he took as a sign that the goat understood the lessons.
Split into simpler sentences: One story says that after Akhfash learned lessons from his teachers he practiced them in front of his goat. Eventually, his goat nodded its head in affirmative, which he took as a sign that the goat understood the lessons.