The correct option is
B was
The given sentence is in past tense, as the words 'five minutes ago' suggests.
Option B: 'Was' answers the question 'Is' in the positive.
'Was' is the past form of 'is', and relates to the given sentence.
Also, 'was' is an elliptical sentence. Such a sentence omits words that have been mentioned before. In the answer, 'here' has been omitted: 'He was here five minutes ago'.
The auxiliary verb is most appropriate as it is in past tense. Hence option B is correct.
Option A: 'Is' is in the present tense and does not relate to the words 'five minutes ago'.
Option C: 'Isn't' is also in the present tense. It is in the negative and does not agree with the contrast 'but he's gone home now'.
Option D: Similarly, 'wasn't' is also in the negative and does not complete the sentence in meaning, because 'he's gone home now', so it means 'he was here before'.
Hence options A, C and D are wrong.