Complex sentence: Olav made it clear that he would only surrender the fortress into Danish hands if he was reinstituted to his former position in Bergen, if these conditions were not met he would hand Älvsborg back to the Swedes.
Split into simpler sentences: Olav made it clear that he would only surrender the fortress into Danish hands if he was reinstituted to his former position in Bergen. If these conditions were not met he would hand Älvsborg back to the Swedes.