GetMouseButtonUp for ResetTrigger doesnt work

Hi so im still learning about animation and i wanted to make a simple jumping and attack animation which has Trigger parameter.

This is my code:

public class PlayerAnimation : MonoBehaviour
{
    private Animator playerAnim;
    private float speed;
    private bool isOnGround = true;
    private 
    // Start is called before the first frame update
    void Start()
    {
        playerAnim = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.LeftShift)) {
            speed += 0.5f * Time.deltaTime;
            playerAnim.SetFloat("speed", speed);
        }
        if (Input.GetKeyUp(KeyCode.LeftShift)) {
            speed = 0;
            playerAnim.SetFloat("speed", speed);
        }
        if (Input.GetKeyDown(KeyCode.Space)) {
            playerAnim.SetTrigger("jump");
        }
        if (Input.GetKeyUp(KeyCode.Space)) {
            playerAnim.ResetTrigger("jump");
        }
        if (Input.GetMouseButtonDown(0)) {
            playerAnim.SetTrigger("attackLight");
        }
        if (Input.GetMouseButtonUp(0)) {
            playerAnim.ResetTrigger("attackLight");
        }
        if (Input.GetMouseButtonDown(1)) {
            playerAnim.SetTrigger("attackHeavy");
        }
        if (Input.GetMouseButtonUp(1)) {
            playerAnim.ResetTrigger("attackHeavy");
        }
    }
}

This is my animator controller:
199381-screenshot-255.png

when i clicked my left mouse it will change to attackLight animation but it wont go back to idle after i release my mouse. its also the same with jump trigger, when i release my space it wont go back either… can someone help asap?

ResetTrigger won’t make player go back to idle, you also need to specify Conditions or Exit time in attackLight and Jump animation. Once conditions are met or animation have played according to the Exit time you have specified, it will automatically go back to idle. Have you specified Conditions or Exit time for attackLight and Jump animation?