Board is 8x8, which is 6 bits. 4 piece type (rook, queen, knight, bishop. I will represent others (king and pawn) in a special way) is 2 bits. So 8 bits in total per piece
I would not use a bit to represent piece color but instead use a seperator to seperate one player's piece from another. Repeating the same position as the last piece can act as a separator since two pieces can't share same square
Kings are special that they must exist, so you don't have to specify their type
Pawns are special, most likely you will have 1 pawn (of each color) in one column and they can be on rows 2 to 7, or they can be dead or they can be "irregular" which means the pawn moved to another column and there are two pawns in that column now. This data is 3 bits per pawn so 48 bits in total. After that data you can put position of all irregular pawns (additional 6 bits for each irregular pawn). If a pawn promotes, it is represented as a regular piece (and can be considered dead in this 48 bit pawn data)
So a chess state is
Pawn data (48 bits)
Irregular pawns (6 bit each but I can't tell how many there can be at max. 8 maybe?)
White king pos (6 bits)
White pieces (6 bits for pos + 2 bits for type \* number of pieces)
Seperator (6 bits)
Black King pos (6 bits)
Black pieces (same as white)
Seperator (6 bits, represents end of data)
I think the worst case scenario is there are 8 promotions which would make it add up 248 bitsIf number of pawns on board is small, it might worth representing them using their full positions and using a bit to decide which representation you picked