Very difficult to explain the php code to hide module on JA Template to you.
You can use other way
1) Log into your Joomla dashboard
2) In the top menu, click Extensions and then click Module Manager
3) In the list of modules on the page, click the module that you don’t want to show for logged in users
4) In the list of settings on the page, find the Access setting:
Access
The access level group that is allowed to view this item.
The default setting is Public, which is everyone that visits your site. This includes both guests and logged in users. To hide this module for users logged in, change the setting value to Guest, which means only guests will have permission to view it. Click Save in the top left of the page to save your settings.
In the screenshots below, both are taken as a logged in user. One screenshot represents when the Public Access is set, and the other shows the Guest Access set.
If you are using Joomla J2.5 refer this link to create Guest access