When I have friends over, I usually say something like “you can take your shoes off if you want”, but I don’t demand it.
I have a friend who is the nicest and cleanest guy in the world, but he has the most horrible foot odor you can imagine, serious, that stank is mutated or something. I know he’s clean and all, it’s horrible! We play squash together, and he has seen at least 3 doctors but no product seems to work. I’m serious, forcing this guy over your carpet would probably end in you having to replace it.
Then there are all the other potential embarrassments like odd-shaped feet, holes in socks, dirty socks.
Naa, in my house it’s optional, and despite my running around in flip-flops or barefoot, I don’t “make” anyone take their shoes off.
As for you yourself, you’re in your house, do whatever the heck you please unless it’s something formal.