Well, it's helpful to draw the axes out in a diagram.
My only input is to remind you of the SRY gene on the Y chromosome that leads to obliteration of the Muellerian duct... SRY accomplishes this by upregulating SOX9, a transcription factor with a DNA-binding site very similar to SRY's. SOX9 in turn upregulates fibroblast growth factor 9 (Fgf9), which is necessary for proper Sertoli cell differentiation.
So, the proper story starts with the SRY gene, and that's why you realize that all XY people have obliteration of the Muellerian duct, even if they are Androgen-Insensitive.
For Testosterone, it promotes development of internal sexual characteristics, including development of the prostate and growth of the penis (or penis-like structure).
For DHT, it promotes development of external sexual characteristics, including development of the penis and labioscrotal fold (note hypospadias in 5aR deficiency) and growth of the prostate.