That merely depends on the order of things!
The following will play the jump animation when the space-key (i.e.
ui_accept) is pressed and play the walk animation when the left- or right-arrow-keys (i.e.
ui_right) are pressed. However, if you press both, it will play the latter.
if Input.is_action_pressed("ui_left") or Input.is_action_pressed("ui_right"):
You can switch the order around (or turn the second
if into an
elif) and you will get the inverse behavior: pressing both actions now will play the jump-animation.
Depending on how exactly you want it to behave, you might need to add further conditions to achieve it, e.g. tracking if the player is in the air or not.