The key difference between choosing whether to use the prepositional case or the accusative case after 'В' is whether there is movement involved. The preposition 'В' is often translated as 'in' but it can also mean 'into'. As a general rule of thumb, if subject is going 'into' an object then the object will be in the accusative. For example, in the sentence 'Мужчин входит в дом' (the man is going into the house), 'дом'(house) is in the accusative case because here 'В' means 'into'. Alternatively if a subject is stationary inside an object, 'В' takes the prepositional case, this is why in the sentence 'Мужчин - в доме'(the man is in the house) 'дом' is in the prepositional case, meaning it takes the ending 'е' becoming 'доме'.