So I recently went through the same problem with my hair... I was diagnosed with PCOS earlier this year and as soon as I started on the new combination of meds and diet (spiro, metformin, low carb) I started having oily hair problems. No matter what type of shampoo or conditioner I used, my hair was still super greasy at the crown of my head/in a section on the back. I researched a little bit and think that the combination of hormone changes plus having very hard water were the culprit.
My boyfriend and I weren't able to afford a water softener, so we installed a shower head filter (https://www.amazon.com/dp/B072FR1RGG/ref=cm\_sw\_r\_cp\_apa\_ixntBb2MV47ND) and that helped a bit.. but what really made a night and day difference was Nioxin level 1 shampoo and conditioner. It's supposed to be for hair loss, and they have different levels for the severity of hair loss. I purchased it first from Ulta to make sure I was getting genuine product, and then found it for cheaper on Amazon and have been ordering it on there from a seller with good reviews. Recently saw they have it at wal mart salons too.
I'm the same as you, I used to have super long gorgeous hair, and it was so depressing to have it look flat and feel so disgusting. It feels like it's back to it's normal texture finally, it's been such a relief. Hope this helps!