Will an iPhone work and still have regular warranty if it's bought outside your country? I did my research and some sources are saying there wouldn't be warranty if your iPhone is bought outside your home country. But I don't know if that rule still applies now. 

I want to buy online on the US apple store 'cause its waaay cheaper than where I reside now.
If your country has an official Apple store, then yes (warranty covers) but it will not be valid if your country has only the official Apple Reseller store. 

You must have a proper purchase bill and verify that you own that hardware, then Apple Store will take care of it. In my case, I had purchased my iPhone in Finland and I was able to get a warranty here in Spain too. 

Offical statement from Apple:

No Apple reseller, agent, or employee is authorized to make any modification, extension, or addition to this Warranty. If any term is held to be illegal or unenforceable, the legality or enforceability of the remaining terms shall not be affected or impaired. This Warranty is governed by and construed under the laws of the country in which the Apple Product purchase took place. Apple or its successor in title is the warrantor under this Warranty.

Detail on it: https://www.apple.com/legal/warranty/products/ios-warranty-document-us.html