Complex sentence: Shaw was elected as a Democratic-Republican to the Fifteenth and Sixteenth Congresses (March 4,1817-March 3,1821), but was an unsuccessful candidate for renomination in 1820.
Split into simpler sentences: Shaw was elected as a Republican to the Fifteenth and Sixteenth Congresses (March 4,1817-March 3,1821). He was an unsuccessful candidate for renomination in 1820.