Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.
you can do it by using template overrides:
1. copy guests.denied.php from /components/com_community/templates/jomsocial/layouts/ to /templates/[your frontend template]/html/com_community/layouts/, create that location if not exist yet.
2. edit it, and remove this code