My dog never leaves the yard. Does he / she still have to be licensed?

Yes. If your dog accidently gets loose or lost, a license tag is the fastest way for him / her to be returned to you.