If a dependent clause of a sentence clearly takes place in the same time (past, present, future) as the main clause, the two verbs should be in the same time.
"It rained when I come home." -- verb tenses disagree.
"It rains when I come home." -- proper.
"It rained when I came home." -- proper.