Install Ubuntu alongside Windows (legacy mode)

Disable UEFI boot support . Now try to install again.
If not working follow these steps...

Shrink your Windows partition
Windows takes up the whole of the drive when it is first installed. In order to install Ubuntu you will need to make space for it.
Press the "super key" (Windows key) on your keyboard and click the magnifying glass in the top right corner. In the search box start typing "Partitions".
Click on the option called "Create and format partitions". This will bring up the "Disk Management" screen. screen

To shrink the drive, right click on the "OS (C:)" volume and select "Shrink volume".

pic

A screen will appear showing how much you can shrink the drive by. You can of course choose to shrink the drive by less than offered but never go for any more than offered as you will break your Windows 8.1 operating system if you do.

Click "Shrink" to continue.

When you are finished you will see that there is a lot of unpartitioned space. This is where Ubuntu will be installed.

Turn off fast boot
Turn off secure boot
Install Ubuntu

for installation guide here

If not working refer here to install manually.