Twenty+ years of Luffy and he's still the hardest character for me to write in a story. I've seen him OOC 90% of the time. That's because (in my opinion) Luffy doesn't belong to AUs.
I use him in AUs too, but I feel like he inevitably becomes OOC. Having him in the canon universe is easier but I won't give too many advices because I can't grasp him either, for some reason.
I'll only say this: Luffy is basically asexual. Any attempt of writing him into a relationship will have to make him OOC. Sorry.