occasional floating is normal, especially in young axolotls, but if he is doing this over and over again there is a problem, he basically has an upset stomach and could be finding it difficult to do his business.
The best thing to do is put him into a shallow container so he can touch the floor, leave him in there somewhere quiet and dark where no one will disturb him, this is so he won't be stressed. The more relaxed he is the better. once you see he has made a mess in the container he should be ok. If he doesn't you can try rubbing gently on his belly, (just make sure your hands are clean)
I had this same problem last week, i put mine into a shallow container and 2 hours later he was fine.