Hi, your history is suggestive of Circadian rhythm related sleep disorders. Your normal day and night rhythm is altered. This especially occurs due to misalignment between the environment and an individual's sleep-wake cycle and is termed as Delayed sleep phase disorder.
More over if you spend too much time in indoor, your body is unable to sense the daylight and it loses touch with the environment and hence there is disturbance in usual night sleep.
Firstly, you need to be in daylight for long hours so that your body can regain the normal day-night cycle. Alternatively, you can stay in bright light during the day, which will help you to stay awake. You need to go for morning exercises and work out which will make you fresh and active all day and tiredness at the end of day will help you to induce sleep naturally.
I suggest you to consult physician. Take acre and regards.
Do not allow yourself to be in a position to toss and turn for an hour. Do not read, or watch tv, study, or do anything in your bed , besides use it for it's primary uses. Do not get into bed until you can barely keep your eyes open. If you are in bed for 20 minutes without falling asleep, get up and do something extremely boarding. Read something that doesn't interest you or watch Bill O Reilly reruns on Fox news late night. Whatever, no bed, until your almost out, get up after 20 minutes if your not sleeping, and bore yourself. Get into bed when you are fading. Stick to this, and you should be able to avoid medicating.