The below query worked for me,
(user.accountEnabled -eq true) -and ((user.department -startsWith "1000") or (user.department -startsWith "1001")) -and ((user.country -eq "A") or (user.country -eq "B") or (user.userPrincipalName -eq "******@contoso.com") or (user.userPrincipalName -eq "******@contoso.com"))
i have used ((user.country -eq "A") or (user.country -eq "B") or (user.userPrincipalName -eq "Test.User1@Company portal .com") or (user.userPrincipalName -eq "Test.User2@Company portal .com")) suspecting if user1 or user2 leave the company still this query will work.
in the below i suspect if user1 or user2 leaves the company the query will not work.
((user.country -eq "A") or (user.country -eq "B")) -and ((user.userPrincipalName -eq "Test.User1@Company portal .com") or (user.userPrincipalName -eq "Test.User2@Company portal .com"))