Kids that young don't really have fully developed empathy yet, they have trouble abstracting that it might hurt or how it feels. So a (gentle!!!) bite back and something to the effect of "see how that doesn't feel good? That's what you're doing to mommy, you're hurting me. Please don't do it again." And if he does, repeat, with no drama so it's not funny/entertaining. Just a calm and gentle demonstration, explanation, followed by a redirection. My kids the same age and a couple months ago would bite for attention, and he's figured out better ways to get attention, such as tapping me on the knee etc
Maybe have a chew toy that he can bite instead of you. When he bites you/goes to bite you just say 'we don't bite people. You can bite this'
I screamed really loud when my son would bite me and he stopped
This might sound a little harsh but bite him back. ( don’t bite to hard tho ) Show him that it doesn’t feel good. That I did with my son. He now three and has not tried or bite me again