I kinda doubt they shot the horse, but they could have had him trained to a wire or some such-been ages since I saw the scene so I would have to look again to hazard an opinion.
But I can say the horse Chuck Connors used in the Rifleman was bought at a ‘show biz horse’ sale and ended up at our barn in Houston in the late 60s. He was in retirement in one of the small pastures, I can’t remember anyone ever riding him, but we barn rats did amuse ourselves figuring out the cues for his tricks. He would rear, lie down (slowly especially given a touch of arthritis) and limp on command. He probably had a lot more in his repertoire, we just never found the buttons.