@SanjayNa I tested below code snippets in the email template and it works fine.
<% if (context.profile.lastName == 'Ross' || context.profile.firstName == 'Bob') { %>Bob<% } else if (context.profile.lastName == 'Smith' && context.profile.firstName == 'John') { %>John<% } else if (context.profile.lastName == 'Williams' && context.profile.firstName == 'Robbie') { %>Robbie<% } else { %>Hancock<% } %>
----------------------------------------------------
<% if (context.profile.lastName == 'Ross' || context.profile.firstName == 'Bob') { %>Bob<% } else if (context.profile.lastName == 'Smith' || context.profile.firstName == 'John') { %>John<% } else if (context.profile.lastName == 'Williams' || context.profile.firstName == 'Robbie') { %>Robbie<% } else { %>Hancock<% } %>
----------------------------------------------------
<% if (context.profile.lastName == 'Ross' && context.profile.firstName == 'Bob') { %>Bob<% } else if (context.profile.lastName == 'Smith' && context.profile.firstName == 'John') { %>John<% } else if (context.profile.lastName == 'Williams' && context.profile.firstName == 'Robbie') { %>Robbie<% } else { %>Hancock<% } %>
Thanks, Sathees