Answer B is better.
Both A and B are grammatically correct. However, A is difficult to read because it’s so long. It’s written in the same way that we tell a story when we’re speaking — in an endless stream of language. Version B is much easier to read because it’s divided into clear, logical sentences.
Our tip: Once you have used three or more conjunctions (e.g. “and”, “but”, “however”, “when”, “if”, “although”, “so”, “because”) in one sentence, it’s definitely time to think about breaking it down into smaller sentences.