Long story short , i inserted a windows 10 bootable USB deleted all partitions previously were installed , did this in command prompt :
diskpart
select disk 0
clean
then installed a windows 10 on the machine .
after that made a new bootable USB with ubuntu 16.04 , after booting the USB ,
before installing i had a warning saying somthing like :
another operatin system (windows 10) is installed , using legacy BIOS and you are trying to install ubuntu through uefi , if you continue you might not be able to load the other operating system
i ignored it and went to install ubuntu, created a new partition alongside windows created a swap partition , and i the bootloader partition i think was the hard disk itself .
after finishing the installation i couldnt see windows entry in grub menu .
after searching i booted again into windows 10 usb and in command prompt i did :
bootsect /nt60 c: /mbr
this command deleted ubuntu grub and now im only able to load into windows 10 .
how can set up grub with both ubuntu and windows 10 entries ?