I’m the farthest thing from an expert on templates round these parts, but I seem to recall that if this is your very first template, then you need to do a full HA restart to get it to show up.
You do not need to restart the entire HA host, but you do need to restart the HA core, when adding a template through a YAML config file.
That goes for the first time and every other time you make a change.
You do have to restart Home Assistant (not reboot!) the first time you use any integration configured in YAML. After that you can use the the reload option without restarting - if you have included a unique_id in the entity configuration.