For example, in one turn, there is a Fighter that has Dual Wielding and uses Attack Action on the greatsword that was previously held. He then chose to release the one hand holding the greatsword and used Interact with object to take out the longsword. Could he still do Two Weapon Fighting?
In order use the Two-weapon fighting Bonus Action you must already have both weapons in hand.
This is confirmed by the Sage Advice Compendium, that clarifies this very exact case:
Can I make an attack with one weapon, then draw a second weapon with my other hand and qualify to use two-weapon fighting?
To use the two-weapon fighting bonus action (PH), you must have both weapons in hand when you make the first attack. If you’re instead fighting with two or more weapons as part of the Extra Attack feature, the rule for the two-weapon fighting bonus action doesn’t apply. The rule for that bonus action applies only to itself, not to any other use of two or more weapons in the game.
The Dual Wielder feat plays no role.
Dual Wielder feat does not allow to use a two handed weapon with just one hand.
The benefits are the following:
You gain a +1 bonus to AC while you are wielding a separate melee weapon in each hand.
You can use two-weapon fighting even when the one-handed melee weapons you are wielding aren't light.
You can draw or stow two one-handed weapons when you would normally be able to draw or stow only one.