You need to edit .tpl files in templates folder, this is mostly like HTML, but when you add HTML ads code, put {literal} and {/literal} before and after of ads code.

You can see more details at smarty manual.

Smarty

You need to find appropriate template file to put the ads, this can be done trail and error or you can ask in the fourm. Mostly template names are related to its functions, for example, header is header.tpl, footer is footer.tpl, index template is index.tpl