Tips for getting baby to nap better?

I’ve been struggling for a couple weeks now trying to get my, now 5 month old, to nap. We went through a phase of not wanting to nap at all and not even seeming tired. The last couple days I’ve only been able to get him to nap for maybe 15-30 minutes every couple hours. As soon as I see him start rubbing his eyes I try to get him to sleep, I make sure the room is dark and I turn on his sound machine, he does fight me for a little while but eventually falls asleep but wakes up very shortly after. Is there anything I can do to get him to take longer naps?