How is the underlined PREPOSITIONAL PHRASE functioning in the following sentence?

Our dog runs in circles when we come home.

Question 6 options:

A)
ADJECTIVE PHRASE modifying "dog"


B)
ADVERB PHRASE modifying "runs"


C)
ADVERB PHRASE modifying "come home"


D)
ADVERB PHRASE modifying "when