Optimizing nested sql query
The following are a few suggestions on how I'd write the SQL.

define your date parameters as variables
create a CTE of table expressions to simplify parts of your query

Source Control
If you don't already have a database project, create one in Visual Studio. Then check it in to source control. Microsoft Azure DevOps Services is free &amp; private for teams of 5 or less (this is per project, so 5 developers per project). Then you'll be able to track changes you make to your stored procedures, views, tables, etc.
Formatting
I use the following tools for SSMS and Visual Studio, ApexSQL Refactor and Poor Man's T-Sql Formatter. I use it when I have to edit other developer's code. It's a great way to standardize your SQL. I find it does most of the formatting for me, but I'll still make a few changes after.

Also check out the book Clean Code. It will change the way you think about naming conventions.


Revised SQL
Without table definitions and sample records I was unable to test this, but it should give you a good start.
DECLARE @ValidFrom  AS DATETIME = '01-Jan-2019';
DECLARE @ValidTo    AS DATETIME = '31-Dec-2019 23:59:59';

WITH
agreements_list
AS
(
   SELECT
        [agr].[Name]
      , [agr].[Link]
   FROM 
      [dbo].[Agreements] 
   WHERE 
      1=1
      AND [TenantId] = 1
      AND [ValidFrom] &gt;= @ValidFrom 
      AND [ValidTo] &lt;= @ValidTo 
)
,
companies_list
AS
(
   SELECT 
        [PartyName] = comp.[Name]
      , [CountryName] = cnt.[Name]
   FROM 
      [dbo].[Companies] AS comp
      LEFT JOIN [dbo].[Countries] AS cnt ON comp.[CountryId] = cnt.[BusinessId] AND comp.[TenantId] = cnt.[TenantId]
   WHERE 
      1=1
      AND comp.[ValidFrom] &gt;= @ValidFrom 
      AND comp.[ValidTo] &lt;= @ValidTo
)
SELECT 
     [agr].[Name]
   , [agr].[Link]
   , [Party 1] = [comp1].[PartyName]
   , [Party 1 Country] = [comp1].[CountryName]
   , [Party 2] = [comp2].[PartyName]
   , [Party 2 Country] = [comp2].[CountryName]
FROM
   agreements_list AS [agr]
   LEFT JOIN companies_list AS [comp1] ON [agr].[Party1CompanyId] = [comp1].[BusinessId] AND [agr].[TenantId] = [comp1].[TenantId]
   LEFT JOIN companies_list AS [comp2] ON [agr].[Party2CompanyId] = [comp2].[BusinessId] AND [agr].[TenantId] = [comp2].[TenantId]