is prego please or you're welcome? or both? and if both, how do I tell them apart?
Yes, it seems to be both. I guess it's just whichever makes more sense in the context.
I've been taught that "prego" has many meanings, depending on the context: "you're welcome, help yourself, go ahead, take a seat" etc. And that what it doesn't mean is "please" (although sometimes used where we would say "please").
I think in English we use "please" mostly in the sense of "per piacere". If someone asks, "May I sit here?", or "May I come in", for example, "Si prego", would be something like "Yes, please do", wouldn't it?