You absolutely must get him out of there because if he doesn't figure out how to get out on his own, he probably won't survive without food and water for more than 4 days in the best case scenario. Read this article, it will help you to get your hamster out from under the floor and save his life