It should be this way: IF [To] = "0" THEN 2018 - INT([Birthyear]) ELSE INT([To]) - INT([Birthyear]) END
I am not sure what data type you are seeing for the "To" and "Birthyear". So, to avoid any issues, I have added an INT function around them.
Maybe something like this will work for you? It outputs "Alive" if To = "0", otherwise, it does the calc of To - Birthyear and converts it to a string.