What is the difference between the two, and what could they both mean in given situations?

I have seen "в" mean "in, at, by" (at least I think)

Are there any specific rules governing the use of one or the other?

Thanks,
-Fantom