Just recently started having a frequent urge to urinate, but only while lying down. Do you know why this could be?

Overactive Bladder? You need to get checked by your primary care doctor as you may have overactive bladder or auti.You will need detailed history, physical exam, urine tst and if indicated imaging of your urinary tract check with your doctor or a urologist.
See answer. Variations in urination and changes in voiding related to position are not uncommon, and often self-limiting and without obvious explanation. Given your young age, it is unlikely related to any serious problem and many times may be related to changes in lifestyle, diet, fluid and caffeine intake, and stress levels. There is increased urine production when lying down, though more common in elderly.