“When i have a old H1 ,can i apply for a new H1 without leaving the country and getting it stamped?”
You can apply for H1 extension or H1 transfer in US through BCIS it is same like new H1
Once you get approval notice you can get it revalidated and can get new H1 visa sticker in Passport IF you have H1Visa sticker in your passport stamped in your home country or by department of state
If you have been out of status then BCIS will not issue you new extended I-94 with H1 approval notice, in that case you have to depart US, get H1 Visa stamped and have to re-enter US and will get new I-94
H1 extension can be applied 6 months advance with BCIS