MacOS wont boot after partitioning my SSD I installed Kali Linux on my iMac as Dual Boot. After a while I needed more space for Kali so I decided to shrink my Mac Partition (APFS) using MacOS Disk Utility Tool. 


I created a new 100 GB Partition (exFat).
I tried to reboot my Computer and only Kali Linux showed up as bootable.


So far I tried to boot in Recovery Mode, but instead of the normal MacOS High Sierra recovery menu the recovery menu from MacOS Lion showed up.

kali@kali:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000MX500SSD1 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: E1EA0C68-DA59-406C-944A-089B812AD69D

Device          Start        End    Sectors   Size Type
/dev/sda1          40     409639     409600   200M EFI System
/dev/sda2      409640 1561962535 1561552896 744,6G Linux filesystem
/dev/sda3  1561964544 1757014015  195049472    93G Microsoft basic data
/dev/sda4  1757276160 1920016383  162740224  77,6G Linux filesystem
/dev/sda5  1920016384 1953523711   33507328    16G Linux swap

kali@kali:~$ sudo gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: hybrid
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with hybrid MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Model: CT1000MX500SSD1 
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): E1EA0C68-DA59-406C-944A-089B812AD69D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 8-sector boundaries
Total free space is 265581 sectors (129.7 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640      1561962535   744.6 GiB   8300                                                                                                   
   3      1561964544      1757014015   93.0 GiB    0700                                                                                                   
   4      1757276160      1920016383   77.6 GiB    8300                                                                                                   
   5      1920016384      1953523711   16.0 GiB    8200   




Any ideas to on how to boot in MacOS without losing all my macOS data?
The answer below was developed based on your question and the image you posted. A cropped version of this image is posted below.



Enter the following from linux.


  Note: I can tell you have taken steps that have not been posted to your question. Therefore, even if the procedure below repairs the partition tables, there may be damage to the APFS container from these steps that are unknown to me.


sudo gdisk /dev/sda
p
x
o
n
m
t
3
8300
n
5
409640
1561962535
AF0A
s
p
w
y


Explanation

Execute gdisk on the internal drive as root user.

sudo gdisk /dev/sda


Print out the GUID Partition Table (GPT) and the Master Boot Record (MBR) partition table.

p
x
o


Change the MBR partition table from hybrid to protective

n


Change the kali volume partition type from Microsoft to linux.

m
t
3
8300


Add back in the APFS partition.

n
5
409640
1561962535
AF0A


Sort the partitions in ascending order.

s


Print the resulting GPT.

p


Write the result back to the internal drive and exit gdisk.

w
y