If someone had sexual thoughts, than liquid discharged from his body but he’s unsure if it’s semen, does he need to do ghusl?

Salaamualiakum, when one cannot ascertain whether the fluid emitted from one`s body is semen, urine or something else, it will be treated as semen if it is thrown out with lust and if the body is slackened. If all or some of these signs are not present the fluid will not be treated as semen. In the case of illness, the fluid may not come out with sudden swiftness and the body may not slacken; but if the emission takes place with lust, it will be treated as semen.