Alliance Captin cannot be changed, except in the following cases

1-If the alliance leader steps down and hands over leadership to another member, this can be done through the following steps:
-Click on the alliance icon at the bottom right of the screen.
-Select "Members." 
-Click on the desired member.
-Choose "replace captain." 

2-If the alliance captain has been offline for seven days, R3 or R4 members can spend 1,000 gold coins to replace them!
You can do so by the following:
-Click the alliance icon on the bottom right of the screen.
-Click on members.
-Click on the captain and choose "Replace Captain".