Complex sentence: In 1785, he was posted to Gibraltar for five years, where he was promoted to captain on 21 May 1790.
Split into simpler sentences: In 1785, he was posted to Gibraltar for five years. Here he was promoted to captain on 21 May 1790.