you could have a urine infection.
I’ll suggest consulting a urologist for the same and getting the uroflowmetry test done which actually tests the emptying of the urinary bladder. There are drugs to take care of the urge incontinence like oxybutinin but this needs to be taken only after consulting a urologist. Also medical conditions like UTI, diabetes, obstruction in the bladder or urethra and kidney causes can cause such urge to urinate and these also need to be ruled out.
I sincerely hope that helps. Take care.