Sporadic absences and double taxation treaties

How sporadic absences count under the 183-day rule and how double taxation treaties resolve tax residency conflicts between two countries.