You are right. I forgot he was a member of the House of Burgesses. However there were several Presidents including Eisenhower who had held no previous elected office. My mistake was not double checking.
Five star General of the Army is a government position, believe me. The only two presidents I know of who never held “elective office” that I’m aware of are General of the Army Grant and General of the Army Eisenhower.