By default, all links are opened in the same window on confluence. In order to open that link in new tab or window, we can open it by CTRL+Click Link on new tab or window.
In order to that behavior automatically, you can make it by adding below scripts to Custom HTML on General Configuration of Confluence. For more information, please refer below steps:
STEP 1. Confluence Administration → General configuration → Custom HTML
STEP 2. Add tags below based on your preference
Option 1) For external links only, like "http://google.com"
Option 2) For all type of links (internal and external)
STEP 3. Click "Save"