When did he start refusing the hay? That's important to know whether this is a recent habit or if it's always been this way.
If your rabbit only wants pellets, that's pretty common, especially if he got used to it from a young age. Rabbits tend to prefer what's softer and tastier, and pellets always win that competition. But here's the thing: hay is essential for his digestive health, it's not just a snack. Without enough hay, you're looking at increased risk of dental problems, constipation, and even more serious intestinal issues.
Try gradually cutting back the pellets (they should only be a small part of any rabbit's diet anyway) and increase his exposure to hay. Mix different types - timothy, fescue, various grasses - because sometimes it's just a texture or flavor thing that doesn't appeal to him. If the hay is really old or smells off, obviously he'll refuse it. Offer hay in different spots around the enclosure, near where he sleeps or spends the most time, because some rabbits are more likely to eat if the hay is right there within reach.
If after a few weeks he's still completely refusing it and you notice other weird signs (less active, irregular droppings, constant teeth grinding), then it's worth getting him checked out by someone who knows exotic pets. There could be something underlying, like dental problems that are causing him pain.