Complex sentence: It was one of his longest assignments, three years, until July 1950, when he was ordered to the aircraft carrier as it's commanding officer until July 1951.
Split into simpler sentences: It was one of his longest assignments, three years, until July 1950. At that time Capt. Davis was ordered to the aircraft carrier as it's commanding officer until July 1951.