That depends.. I'm not a fan of the "pop in" .. I don't show up to people's houses unless they know for sure that I'm coming over and I don't appreciate it when people don't give me that same respect.
Now, if you've told them you're not going to be home as a means to try and gently let them know not to come over (but you are in fact home) I simply wouldn't answer the door. lol. I'm crabby like that I suppose. If they can't take the gentle hint that I'd prefer they didn't come over, then I would simply ignore the knocks on the door until the finally get the hint. That may be rude, but it's also rude just to show up at someone's house when they haven't been invited.
If they show up at your house, and you are in fact not home.. well, then I suppose that's their problem isn't it? If they want to waste their own time showing up when you've already told them you won't be home- perhaps they'll take it as a cue to develop their listening skills a little better. :)