You can't change your gamertag directly on the console. Use a web browser or the Xbox app instead.
Some users report success via the Xbox app on Windows, but availability varies.
If issues persist, contact Xbox Support directly.