How to make combo is fighting games?

how to make something like if you press right twice it will start running,but if you press right once and press it again 2 second later,it will just walk?