It is becaue of how PHP arrays work, you are overwriting the terms
query each time, instead try something along the lines of:
array(
'body' => array('query' =>
'bool' => array(
'must' => array(
array('terms' => array('country' => implode(' ', $countries))),
array('terms' => array('category' => implode(' ', $category))),
)
)
))
minimum_should_match
is useless with must
clause of the query.