Since the footer is a visible piece of your site, it should go within the body.
Does footer go inside main?
main holds your "main content", and the header and footer is usually separate from that. As for the ARIA-role, it should be implicit, but for the time being, it is recommended that you give it the role manually.
Where do you put the footer?
The obvious place for the <footer> element is at the bottom of a web page.