The 1st form of the boss is just a classic "shoot the head and avoid its attacks" it does not last too long assuming all your equipped weapons and armor are leveled correctly for that fight (you should have Gear Score 12 to not be under disadvantage in damage dealing and resisitance, as it's apparently that boss level).
The problem start with its 2nd form, when you start to shoot at that big thing for a while you notice you barely take half of a pixel of his gigantic health bar, fortunately his attacks are super easy to avoid by just sprinting to the side when the boss shoot.
After some time the boss will teleport you into some dark area (that progressively lower your health bar) with randomly spawning root warriors and a portal in the end of that area.
So you run to the portal to exit and you're fighting the boss again, you eat bloodwort to regen the health lost in the dark zone, but still barely making any damage to the boss while easily avoiding his attacks until he re-teleport you back into the dark zone
Repeat until you run out of ammo and ammo refilling item or have stopped playing because it's taking way too long.
Now the trick to not fall in this never ending repetition is that once you're in the dark zone, instead of just running to the portal to exit , kill as much of the root warriors that spawn as possible (tip : get your summons there to help kill faster) and as fast as possible (as if you take too long elite/boss version of those root warriors will start to spawn and make things much harder), between 5 and 10 kills are enough , and be cautious of your ever lowering health, make sure to have bloodwort items with you to spare your dragon hearts.
Murder Dog is a great mod to have in the dark zone, his damage dealing is excellent and helps a lot in getting root warriors killed fast, so if you go to Rohm and meet the blind merchant, make sure to pet his dog to obtain the related summon as a weapon mod.
Murder Dog is a good Dog
Killing root warriors will add some "stack" on the bottom of the screen.
What those "stacks" do is that once you exit the dark zone through its portal, they massively increase the damage you're going to do to the boss shield, good idea to use machinegun/continuous beam type of rifle to build up damage even faster. After a while the boss shield will explode for a dozen of second, during that time shoot the head of the dreamer stuck inside to deliver insane amount of damage to the boss health bar.
After the time is elapsed the shield reform and the boss throw you back to the dark zone, re-accumulate some kills and go back to explode the boss shield again and shoot the dreamer head until he boss dies.