The Prince and the Pauper (1990)
A poor boy and a prince exchange identities and lives while the villainous Captain of the Guard plots to take advantage of this