All the dudes on this thread are not wrong in what they're saying, but I do believe you can make some choices while picking compounds to minimize your hair loss.
I am very prone to MPB and started losing my hair in my mid 20's. I got on a decent regimen and have picked compounds selectively and I am pretty happy with how my hair has held up.
My first couple cycles were Test only as when matched with Finasteride/Dutast, I was able to almost completely get in the middle of the DHT conversion.
Now the DHT derivates are tricky due to you can not get in the middle of 5-ar as it is already entering you body as DHT. I was successfully able to run Anavar at 25mg by adding RU58841 & 2% Ketoconazole shampoo. These topical "anti-androgen's" will aid your hair but it is not bullet proof plan. How these things helped me might not help everyone else.
Superdrol is another compound that is oddly hair safe at low dosages for short periods of time as long as your willing to put a huge bourdon on you liver.
The same can be said for Anadrol. I viewed some really interesting content about how if you take Anadrol sub-lingually vs. orally, the bioavailability is much higher. So basically you will achieve the peak of the compounds effects quicker and it will be out of your system faster with a fraction of the drug needed. This paired with a topical anti-androgen was argued to have great hair saving results. Now this would still create the same debate on if your hair line is more important than your liver, but that would be your own question to answer.
The hair saving game is a tough one.
Hope this helps.