You can use a subquery to get the most recent effective date and then use a CASE statement in your UPDATE statement to check if the effective date is null or not. Here's an example:
UPDATE U
SET Lastname = C.[LAST_NAME],
FirstName = C.[FIRST_NAME],
FullName = C.FULL_NAME,
EMailAddress = C.[EMAIL_ADDRESS],
PersonNumber = C.[PERSON_NUMBER],
[Manager] = CASE
WHEN C.EffectiveFromDate = (SELECT MAX(EffectiveFromDate)
FROM [Stage].[dbo].[Stg_USER]
WHERE PERSON_ID = C.PERSON_ID
AND EffectiveFromDate < GETDATE())
THEN C.Manager
ELSE U.[Manager]
END,
EffectiveFromDate = CASE
WHEN C.EffectiveFromDate = (SELECT MAX(EffectiveFromDate)
FROM [Stage].[dbo].[Stg_USER]
WHERE PERSON_ID = C.PERSON_ID
AND EffectiveFromDate < GETDATE())
THEN C.EffectiveFromDate
ELSE U.EffectiveFromDate
END,
EffectiveToDate = C.EffectiveToDate,
DeptNumber = C.DeptNumber,
UserStatus = C.UserStatus,
Division = C.Division,
Client = C.Client_MANDT
FROM Dim.dbo.User U
INNER JOIN [Stage].[dbo].[Stg_USER] C
ON C.PERSON_ID = U.PersonID
WHERE C.[EffectiveToDate] IS NULL
OR C.EffectiveFromDate = (SELECT MAX(EffectiveFromDate)
FROM [Stage].[dbo].[Stg_USER]
WHERE PERSON_ID = C.PERSON_ID
AND EffectiveFromDate < GETDATE())
This query will update the target table records from the stage table fields based on the conditions you mentioned in your question. The subquery in the CASE statement will get the most recent effective date for the same person ID and check if it's the same as the current effective date in the stage table. If it is, then it will update the Manager and EffectiveFromDate fields with the values from the stage table, otherwise, it will keep the values from the target table.