Complex sentence: The Ottomans however used it for gunpowder storage, and in 1490, when the building was struck by a lightning, it was destroyed and torn down.
Split into simpler sentences: The Ottomans however used it for gunpowder storage. Thus in 1490, when the building was struck by a lightning, it was destroyed and subsequently torn down.