He got out of bed and grabbed his gun when the doorbell rang because really old people don't have visitors at 10pm. He didn't check to see what race the person was and then grab his gun, he didn't see the person at all when he grabbed it. He didn't mag dump on the guy, he shot twice and immediately called the police, and while police were at his house, he asked them for multiple updates on how the guy was doing.
As far as whether he goes to prison, that's not clear either. Just because Ralph Yarl didn't do anything wrong doesn't necessarily mean the old guy committed a crime. I don't believe it's required for a suspected burglar to enter the home, they just have to decide if it was reasonable for the person in the house to believe that's what was happening. They might rule that he didn't take enough steps to assess, but it's certainly not an unreasonable initial assumption.
Anthony Smith had a burglar show up and said his assumption when someone breaks in at night is that they wouldn't do it with people home if they weren't armed. Jon Jones also had someone outside his house and chased the guy down with a shotgun.