The correct option is D while
Conjunctions are words that link other words, phrases, or clauses together. Subordinating conjunctions join independent and dependent clauses. Subordinating conjunction can signal a cause-and-effect relationship, a contrast, or some other kind of relationship between the clauses. Common subordinating conjunctions are because, since, as, although, though, while, and whereas. These show relation in time, place or condition. While is used to indicate"during the time that something happened”. In the given sentence the speaker informs that during his stay in Rome he hopes to visit a friend. Thus Option D is correct. When is used 'at or during the time that something happened.' and means ‘at the time that’. Option A is incorrect as it refers to the particular moment. As soon as is used to say that something will happen immediately after something else has happened. Thus Option c is incorrect as one does not visit a friend immediately as one goes to visit a place. Option B can be ruled out as If is used to talk about the result or effect of something that may happen or be true. In the given sentence it is confirmed that the speaker is going to Rome next week while if indicates a an incident which might happen or might not.