How does this work?
How does the player choose the item he wants to change the name of via command?
Does he have it activated in his belt?
Will there open a box to put an item in to rename?

It's the active item (the one they have in their hand/selected).

All of the other information is easily found in the documentation.